File tree 5 files changed +27
-7
lines changed
account_currency_reports_ux
5 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
# Part of Odoo. See LICENSE file for full copyright and licensing details.
3
3
4
- from . import report
4
+ from . import hooks
5
+ from . import monkey_patches
Original file line number Diff line number Diff line change 40
40
'installable' : True ,
41
41
'auto_install' : False ,
42
42
'application' : False ,
43
+ 'post_load' : 'monkey_patches' ,
44
+ 'uninstall_hook' : 'uninstall_hook'
43
45
}
Original file line number Diff line number Diff line change
1
+ ##############################################################################
2
+ # For copyright and license notices, see __manifest__.py file in module root
3
+ # directory
4
+ ##############################################################################
5
+ from odoo .addons .account .report .account_invoice_report import AccountInvoiceReport
6
+
7
+ def _revert_method (cls , name ):
8
+ """ Revert the original method called ``name`` in the given class.
9
+ See :meth:`~._patch_method`.
10
+ """
11
+ method = getattr (cls , name )
12
+ setattr (cls , name , method .origin )
13
+
14
+
15
+ def uninstall_hook (cr , registry ):
16
+ _revert_method (AccountInvoiceReport , '_select' )
17
+ _revert_method (AccountInvoiceReport , '_from' )
Original file line number Diff line number Diff line change 1
1
from odoo import models , api
2
+ from odoo .addons .account .report .account_invoice_report import AccountInvoiceReport
2
3
3
- class AccountInvoiceReport (models .Model ):
4
- _inherit = "account.invoice.report"
4
+ def monkey_patches ():
5
5
6
+ # monkey patch
6
7
@api .model
7
8
def _select (self ):
8
9
return '''
@@ -84,3 +85,6 @@ def _from(self):
84
85
(currency_table.date_end IS NULL OR currency_table.date_end > COALESCE(line.date, NOW())))
85
86
LEFT JOIN res_company rc on rc.id=line.company_id
86
87
'''
88
+
89
+ AccountInvoiceReport ._select = _select
90
+ AccountInvoiceReport ._from = _from
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments