Skip to content

Commit

Permalink
[MIG] pos_timeout: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benwillig committed Jan 29, 2024
1 parent 6d75742 commit 0c14c0d
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 75 deletions.
12 changes: 6 additions & 6 deletions pos_timeout/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Point of Sale - timeout
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/14.0/pos_timeout
:target: https://github.com/OCA/pos/tree/16.0/pos_timeout
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_timeout
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_timeout
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -55,7 +55,7 @@ To configure this module, you need to:
* Go to 'Point Of Sale' / 'Configuration' / 'Point of Sale' and edit your
PoS Config, setting a timeout

.. figure:: https://raw.githubusercontent.com/OCA/pos/14.0/pos_timeout/static/description/pos_config.png
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_timeout/static/description/pos_config.png
:alt: PoS Configuration
:width: 800 px

Expand All @@ -67,7 +67,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_timeout%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_timeout%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -106,6 +106,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/14.0/pos_timeout>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_timeout>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
12 changes: 9 additions & 3 deletions pos_timeout/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
{
"name": "Point of Sale - timeout",
"summary": "Set the timeout of the point of sale",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Sales/Point Of Sale",
"website": "https://github.com/OCA/pos",
"author": "GRAP, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["point_of_sale"],
"images": ["static/description/pos_config.png"],
"data": ["views/view_pos_config.xml", "views/templates.xml"],
"qweb": ["static/src/xml/pos_timeout.xml"],
"data": [
"views/res_config_settings.xml",
],
"assets": {
"point_of_sale.assets": [
"pos_timeout/static/src/js/models.js",
],
},
"installable": True,
}
1 change: 1 addition & 0 deletions pos_timeout/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import pos_config
from . import res_config_settings
10 changes: 10 additions & 0 deletions pos_timeout/models/res_config_settings.py
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,
)
9 changes: 4 additions & 5 deletions pos_timeout/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -369,7 +368,7 @@ <h1 class="title">Point of Sale - timeout</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d54c8788b013efa2b63a2c6c2df2db2031588af20479176e761d9c488dbcdea0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/14.0/pos_timeout"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-14-0/pos-14-0-pos_timeout"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/16.0/pos_timeout"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_timeout"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Point of Sale module.</p>
<p>By default, in Odoo a timeout is set to 30 seconds for the creation of
a PoS order. This threshold is usually sufficient, but in some cases it is not,
Expand Down Expand Up @@ -402,7 +401,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
PoS Config, setting a timeout</li>
</ul>
<div class="figure">
<img alt="PoS Configuration" src="https://raw.githubusercontent.com/OCA/pos/14.0/pos_timeout/static/description/pos_config.png" style="width: 800px;" />
<img alt="PoS Configuration" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_timeout/static/description/pos_config.png" style="width: 800px;" />
</div>
<p>If not set, the default Odoo timeout will be used. (7.5 seconds in V10.0)</p>
</div>
Expand All @@ -411,7 +410,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_timeout%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_timeout%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -444,7 +443,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/14.0/pos_timeout">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_timeout">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
22 changes: 22 additions & 0 deletions pos_timeout/static/src/js/models.js
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;
});
27 changes: 0 additions & 27 deletions pos_timeout/static/src/js/pos_timeout.js

This file was deleted.

25 changes: 25 additions & 0 deletions pos_timeout/views/res_config_settings.xml
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>
11 changes: 0 additions & 11 deletions pos_timeout/views/templates.xml

This file was deleted.

23 changes: 0 additions & 23 deletions pos_timeout/views/view_pos_config.xml

This file was deleted.

1 change: 1 addition & 0 deletions setup/pos_timeout/odoo/addons/pos_timeout
6 changes: 6 additions & 0 deletions setup/pos_timeout/setup.py
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,
)

0 comments on commit 0c14c0d

Please sign in to comment.