Skip to content

Commit

Permalink
shopfloor_packing_info: depend on stock_picking_partner_note
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Feb 16, 2024
1 parent c114af4 commit 7f41757
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 46 deletions.
3 changes: 1 addition & 2 deletions shopfloor_packing_info/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"depends": ["shopfloor", "sales_team"],
"depends": ["shopfloor", "sales_team", "stock_picking_partner_note"],
"data": [
"security/ir.model.access.csv",
"views/res_partner_views.xml",
"views/shopfloor_packing_info_views.xml",
"views/stock_picking_type_views.xml",
"views/stock_picking_views.xml",
"views/menus.xml",
],
Expand Down
1 change: 0 additions & 1 deletion shopfloor_packing_info/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
from . import res_partner
from . import shopfloor_packing_info
from . import stock_picking
from . import stock_picking_type
3 changes: 0 additions & 3 deletions shopfloor_packing_info/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ class StockPicking(models.Model):
string="Packing information",
related="partner_id.shopfloor_packing_info_id",
)
shopfloor_display_packing_info = fields.Boolean(
related="picking_type_id.shopfloor_display_packing_info",
)
13 changes: 0 additions & 13 deletions shopfloor_packing_info/models/stock_picking_type.py

This file was deleted.

2 changes: 1 addition & 1 deletion shopfloor_packing_info/services/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CheckoutExt(Checkout):

def _data_for_packing_info(self, picking):
res = super()._data_for_packing_info(picking)
if picking.picking_type_id.shopfloor_display_packing_info:
if picking.note:
shopfloor_packing_info = (
picking.shopfloor_packing_info_id.text
if picking.shopfloor_packing_info_id
Expand Down
1 change: 1 addition & 0 deletions shopfloor_packing_info/tests/test_checkout_scan_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_scan_line_package_ok_packing_info_filled_info(self):
.create({"name": "Test", "text": packing_info_text})
)
picking.sudo().partner_id.shopfloor_packing_info_id = shopfloor_packing_info
# TODO: shopfloor_display_packing_info doesn't exist anymore
picking.sudo().picking_type_id.shopfloor_display_packing_info = True
move1 = picking.move_lines[0]
move2 = picking.move_lines[1]
Expand Down
16 changes: 0 additions & 16 deletions shopfloor_packing_info/views/stock_picking_type_views.xml

This file was deleted.

12 changes: 2 additions & 10 deletions shopfloor_packing_info/views/stock_picking_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@
position="before"
>
<group name="shopfloor">
<field name="shopfloor_display_packing_info" invisible="1" />
<field
name="shopfloor_packing_info_id"
attrs="{'invisible':[('shopfloor_display_packing_info', '=', False)]}"
/>
<field name="shopfloor_packing_info_id" />
</group>
</xpath>
<xpath
expr="//notebook/page[2]//button[@name='action_put_in_pack']"
position="before"
>
<group name="shopfloor">
<field name="shopfloor_display_packing_info" invisible="1" />
<field
name="shopfloor_packing_info_id"
attrs="{'invisible':[('shopfloor_display_packing_info', '=', False)]}"
/>
<field name="shopfloor_packing_info_id" />
</group>
</xpath>
</field>
Expand Down

0 comments on commit 7f41757

Please sign in to comment.