1
1
# Copyright 2017 Akretion (http://www.akretion.com)
2
+ # Copyright 2020 Camptocamp SA
2
3
# Mourad EL HADJ MIMOUNE <[email protected] >
3
4
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
4
5
5
- import logging
6
-
7
6
from odoo import api , models
8
7
9
- logger = logging .getLogger (__name__ )
10
-
11
8
12
9
class PurchaseOrder (models .Model ):
13
10
_inherit = ["purchase.order" , "base.exception" ]
@@ -20,22 +17,6 @@ def test_all_draft_orders(self):
20
17
order_set .detect_exceptions ()
21
18
return True
22
19
23
- @api .model
24
- def _exception_rule_eval_context (self , rec ):
25
- # TODO remove in v13
26
- # We keep this only for backward compatibility
27
- res = super ()._exception_rule_eval_context (rec )
28
- if res .get ("purchase" ):
29
- logger .warning (
30
- """
31
- For a full compatibility with future versions of this module,
32
- please use 'self' instead of 'purchase' in your
33
- custom exceptions rules.
34
- """
35
- )
36
- res ["purchase" ] = rec
37
- return res
38
-
39
20
@api .model
40
21
def _reverse_field (self ):
41
22
return "purchase_ids"
@@ -57,15 +38,13 @@ def onchange_ignore_exception(self):
57
38
if self .state == "purchase" :
58
39
self .ignore_exception = False
59
40
60
- @api .multi
61
41
def button_confirm (self ):
62
42
if self .detect_exceptions () and not self .ignore_exception :
63
43
return self ._popup_exceptions ()
64
- return super (PurchaseOrder , self ).button_confirm ()
44
+ return super ().button_confirm ()
65
45
66
- @api .multi
67
46
def button_draft (self ):
68
- res = super (PurchaseOrder , self ).button_draft ()
47
+ res = super ().button_draft ()
69
48
for order in self :
70
49
order .exception_ids = False
71
50
order .main_exception_id = False
0 commit comments