Skip to content

Commit

Permalink
[MIG] sale_exception: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasperalta1 committed Nov 17, 2022
1 parent 1df77fa commit 0c33215
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sale_exception/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Sale Exception",
"summary": "Custom exceptions on sale order",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Generic Modules/Sale",
"author": "Akretion, "
"Sodexis, "
Expand Down
7 changes: 4 additions & 3 deletions sale_exception/data/sale_exception_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
<field name="description">Not Enough Virtual Stock</field>
<field name="sequence">50</field>
<field name="model">sale.order.line</field>
<field name="code">failed=self.product_id and self.product_id.type == 'product'
and self.virtual_available_at_date &lt; self.product_uom_qty</field>
<field
name="code"
>failed=self.product_id and self.product_id.type == 'product' and self.virtual_available_at_date &lt; self.product_uom_qty</field>
<field name="active" eval="False" />
</record>
<record id="exception_partner_sale_warning" model="exception.rule">
Expand All @@ -43,7 +44,7 @@
<field name="description">The product has a warning in his form</field>
<field name="sequence">40</field>
<field name="model">sale.order.line</field>
<field name="code">failed=self.product_id.sale_line_warn == "warning"</field>
<field name="code">failed=self.sale_line_warn == "warning"</field>
<field name="active" eval="False" />
</record>
</odoo>
2 changes: 1 addition & 1 deletion sale_exception/tests/test_sale_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_exception_product_sale_warning(self):
partner=self.env.ref("base.res_partner_1"), product=product
)
sale_order.action_confirm()
product.sale_line_warn = "warning"
self.sale_line_warn = "warning"
sale_order2 = sale_order.copy()
sale_order2.detect_exceptions()
self.assertTrue(sale_order2.exception_ids.filtered(lambda x: x == exception))

0 comments on commit 0c33215

Please sign in to comment.