Skip to content

Commit

Permalink
[14.0][MIG] purchase_exceptoin
Browse files Browse the repository at this point in the history
  • Loading branch information
kittiu authored and aliciagaarzo committed Feb 21, 2023
1 parent 4f156a6 commit 496d7e4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 102 deletions.
79 changes: 0 additions & 79 deletions purchase_exception/README.rst

This file was deleted.

3 changes: 2 additions & 1 deletion purchase_exception/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
{
"name": "Purchase Exception",
"summary": "Custom exceptions on purchase order",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Generic Modules/Purchase",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"depends": ["purchase", "base_exception"],
"license": "AGPL-3",
"data": [
"security/ir.model.access.csv",
"data/purchase_exception_data.xml",
"wizard/purchase_exception_confirm_view.xml",
"views/purchase_view.xml",
Expand Down
3 changes: 2 additions & 1 deletion purchase_exception/models/exception_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ class ExceptionRule(models.Model):
selection_add=[
("purchase.order", "Purchase order"),
("purchase.order.line", "Purchase order line"),
]
],
ondelete={"purchase.order": "cascade", "purchase.order.line": "cascade"},
)
1 change: 1 addition & 0 deletions purchase_exception/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Mourad EL HADJ MIMOUNE <[email protected]>
* Sudhir Arya <[email protected]>
* Kitti U. <[email protected]> (migration to v14)
2 changes: 2 additions & 0 deletions purchase_exception/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_purchase_exception_confirm,access_purchase_exception_confirm,model_purchase_exception_confirm,base.group_user,1,1,1,1
3 changes: 0 additions & 3 deletions purchase_exception/tests/test_purchase_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def setUp(self):

def test_purchase_order_exception(self):
self.exception_noemail.active = True
self.exception_noemail.next_state = False
self.exception_qtycheck.active = True
self.partner_id.email = False
self.po = self.PurchaseOrder.create(self.po_vals.copy())
Expand Down Expand Up @@ -107,8 +106,6 @@ def test_purchase_order_exception(self):
self.po.button_draft()
self.assertEqual(self.po.state, "draft")
self.assertTrue(not self.po.ignore_exception)
# test next_state
self.exception_noemail.next_state = "to approve"
self.po.button_confirm()
self.assertTrue(self.po.state, "to approve")

Expand Down
36 changes: 18 additions & 18 deletions purchase_exception/views/purchase_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@
name="context"
>{'active_test': False, 'default_model' : 'purchase.order'}</field>
</record>
<menuitem
id="menu_purchase_exception_parent"
parent="purchase.menu_product_in_config_purchase"
sequence="20"
name="Exceptions"
/>
<menuitem
action="action_purchase_test_tree"
id="menu_purchase_test"
parent="menu_purchase_exception_parent"
parent="purchase.menu_purchase_config"
/>
<record id="view_order_form" model="ir.ui.view">
<field name="name">purchase_exception.view_order_form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<header position="after">
<sheet position="before">
<div
groups="purchase.group_purchase_user"
class="alert alert-danger alert-dismissable"
class="alert alert-danger"
role="alert"
style="margin-bottom:0px;"
attrs="{'invisible':[('main_exception_id','=', False)]}"
attrs="{'invisible': [('exceptions_summary','=',False)]}"
>
<bold>You have an outstanding
exception to manage:
<field
name="main_exception_id"
options='{"no_open": True}'
/></bold>
<p>
<strong
>There are exceptions blocking this Purchase Order:</strong>
</p>
<field name="exceptions_summary" />
<button
name="action_ignore_exceptions"
type="object"
class="btn-danger"
string="Ignore Exceptions"
help="Click here to be able to confirm this Agreement regardless of the exceptions."
groups="base_exception.group_exception_rule_manager"
/>
</div>
</header>
</sheet>
<xpath expr="//field[@name='date_order']/.." position="inside">
<field
name="ignore_exception"
Expand Down

0 comments on commit 496d7e4

Please sign in to comment.