Skip to content

Commit

Permalink
[MIG] pos_picking_delayed: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
em230418 committed Jul 24, 2024
1 parent 4055ede commit 312d045
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions pos_picking_delayed/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import pos_config
from . import pos_order
from . import res_config_settings
13 changes: 13 additions & 0 deletions pos_picking_delayed/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Eugene Molotov (https://github.com/em230418)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

picking_creation_delayed = fields.Boolean(
related="pos_config_id.picking_creation_delayed", readonly=False
)
6 changes: 2 additions & 4 deletions pos_picking_delayed/tests/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setUp(self):
def test_01_picking_delayed_enabled(self):
# Enable feature
self.pos_config.picking_creation_delayed = True
self.pos_config.open_session_cb()
self.pos_config.open_ui()

order = self._create_order()

Expand All @@ -61,7 +61,7 @@ def test_01_picking_delayed_enabled(self):
def test_02_picking_delayed_disabled(self):
# Disable feature
self.pos_config.picking_creation_delayed = False
self.pos_config.open_session_cb()
self.pos_config.open_ui()

order = self._create_order()

Expand All @@ -80,7 +80,6 @@ def test_02_picking_delayed_disabled(self):
def _create_order(self):
# Create order
account_id = self.env.user.partner_id.property_account_receivable_id
statement_id = self.pos_config.current_session_id.statement_ids[0]
payment_methods = self.pos_config.current_session_id.payment_method_ids
order_data = {
"id": "0006-001-0010",
Expand Down Expand Up @@ -114,7 +113,6 @@ def _create_order(self):
"amount": 0.9,
"name": fields.Datetime.now(),
"account_id": account_id.id,
"statement_id": statement_id.id,
"payment_method_id": payment_methods.filtered(
lambda pm: pm.is_cash_count
and not pm.split_transactions
Expand Down
11 changes: 7 additions & 4 deletions pos_picking_delayed/views/view_pos_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-->
<odoo>

<record id="view_pos_config_form" model="ir.ui.view">
<field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form" />
<record id="res_config_settings_view_form" model="ir.ui.view">
<field
name="name"
>res.config.settings.view.form.inherit.pos.picking.delayed</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" />
<field name="arch" type="xml">

<xpath expr="//div[@id='inventory_location']" position="inside">
<xpath expr="//div[@id='pos_inventory_section']" position="inside">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="picking_creation_delayed" />
Expand Down

0 comments on commit 312d045

Please sign in to comment.