-
-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] pos_timeout: Migration to 16.0
- Loading branch information
Showing
12 changed files
with
84 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import pos_config | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
pos_order_timeout = fields.Integer( | ||
related="pos_config_id.pos_order_timeout", | ||
readonly=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
odoo.define("pos_timeout.models", function (require) { | ||
"use strict"; | ||
|
||
const PosModels = require("point_of_sale.models"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
const PosGlobalState = (OriginalPosGlobalState) => | ||
class extends OriginalPosGlobalState { | ||
_save_to_server(orders, options) { | ||
const configTimeout = this.env.pos.config.pos_order_timeout; | ||
if (configTimeout) { | ||
options.timeout = configTimeout * 1000 * orders.length; | ||
} | ||
|
||
return super._save_to_server(orders, options); | ||
} | ||
}; | ||
|
||
Registries.Model.extend(PosModels.PosGlobalState, PosGlobalState); | ||
|
||
return PosGlobalState; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="res_config_settings_view_form"> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="95" /> | ||
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='pos_interface_section']" position="inside"> | ||
<div class="col-12 col-lg-6 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="pos_order_timeout" /> | ||
<div class="text-muted"> | ||
client-side timeout for the creation of PoS Order(s) from the POS UI | ||
</div> | ||
<div class="content-group mt16"> | ||
<field name="pos_order_timeout" /> | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../pos_timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |