Skip to content

Commit

Permalink
[MIG] sale_product_pack: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-zanotti committed Jan 9, 2024
1 parent 1e945ff commit 534c9a6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sale_product_pack/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Product Pack",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Sales",
"summary": "This module allows you to sell product packs",
"website": "https://github.com/OCA/product-pack",
Expand Down
1 change: 0 additions & 1 deletion sale_product_pack/demo/sale_pack_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<field name="partner_shipping_id" ref="base.partner_demo_portal" />
<field name="user_id" ref="base.user_admin" />
<field name="payment_term_id" ref="account.account_payment_term_30days" />
<field name="pricelist_id" ref="product.list0" />
<field name="team_id" ref="sales_team.team_sales_department" />
<field
name="date_order"
Expand Down
2 changes: 1 addition & 1 deletion sale_product_pack/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def copy(self, default=None):
sale_copy = super().copy(default)
# we unlink pack lines that should not be copied
pack_copied_lines = sale_copy.order_line.filtered(
lambda l: l.pack_parent_line_id.order_id == self
lambda line: line.pack_parent_line_id.order_id == self
)
pack_copied_lines.unlink()
return sale_copy
Expand Down
2 changes: 1 addition & 1 deletion sale_product_pack/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def expand_pack_line(self, write=False):
if write:
existing_subline = first(
self.pack_child_line_ids.filtered(
lambda child: child.product_id == subline.product_id
lambda child, s=subline: child.product_id == s.product_id
)
)
# if subline already exists we update, if not we create
Expand Down
2 changes: 2 additions & 0 deletions sale_product_pack/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
- Daniel Reis \<<dreis@opensourceintegrators.com>\>
- [Acsone](https://www.acsone.eu/):
- Maxime Franco
- [ADHOC SA](https://www.adhoc.com.ar):
- Bruno Zanotti
6 changes: 3 additions & 3 deletions sale_product_pack/views/product_pack_line_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
expr="//field[@name='order_line']/tree//field[@name='price_subtotal']"
position="after"
>
<field name="pack_modifiable" invisible="True" />
<field name="pack_parent_line_id" invisible="True" />
<field name="pack_modifiable" column_invisible="True" />
<field name="pack_parent_line_id" column_invisible="True" />
<button
string="Parent Pack is not modifiable"
name="action_open_parent_pack_product_view"
type="object"
attrs="{'invisible': ['|', ('pack_parent_line_id', '=', False), ('pack_modifiable', '=', True)]}"
invisible="not pack_parent_line_id or pack_modifiable"
icon="fa-lock"
/>
</xpath>
Expand Down

0 comments on commit 534c9a6

Please sign in to comment.