replace 'domain' with 'context_domain' in 'ir.action.act_window'
This commit is contained in:
parent
a32b863d8a
commit
115204bd2e
4 changed files with 32 additions and 3 deletions
|
@ -10,7 +10,7 @@ from .currency import Currency
|
||||||
from .evaluation_context import EvaluationContext
|
from .evaluation_context import EvaluationContext
|
||||||
from .evaluation_wizard import OpenChartWizard
|
from .evaluation_wizard import OpenChartWizard
|
||||||
from .investment import InvestmentEvaluation, InvestmentLine
|
from .investment import InvestmentEvaluation, InvestmentLine
|
||||||
from .ir import Rule
|
from .ir import Rule, IrActWindow
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
@ -20,6 +20,7 @@ def register():
|
||||||
EvaluationLine,
|
EvaluationLine,
|
||||||
EvaluationContext,
|
EvaluationContext,
|
||||||
Rule,
|
Rule,
|
||||||
|
IrActWindow,
|
||||||
module='cashbook_report', type_='model')
|
module='cashbook_report', type_='model')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
OpenChartWizard,
|
OpenChartWizard,
|
||||||
|
|
|
@ -221,7 +221,7 @@ class Evaluation(sequence_ordered(), ModelSQL, ModelView):
|
||||||
'name': evaluation.name,
|
'name': evaluation.name,
|
||||||
'res_model': 'cashbook_report.eval_line',
|
'res_model': 'cashbook_report.eval_line',
|
||||||
'usage': 'dashboard',
|
'usage': 'dashboard',
|
||||||
'domain': '[["evaluation", "=", %d]]' % evaluation.id,
|
'context_domain': '[["evaluation", "=", %d]]' % evaluation.id,
|
||||||
}])
|
}])
|
||||||
|
|
||||||
dashb_actview, = ActView.create([{
|
dashb_actview, = ActView.create([{
|
||||||
|
|
27
ir.py
27
ir.py
|
@ -18,3 +18,30 @@ class Rule(metaclass=PoolMeta):
|
||||||
'ir.action.act_window', 'cashbook_report.evaluation']
|
'ir.action.act_window', 'cashbook_report.evaluation']
|
||||||
|
|
||||||
# end Rule
|
# end Rule
|
||||||
|
|
||||||
|
|
||||||
|
class IrActWindow(metaclass=PoolMeta):
|
||||||
|
__name__ = 'ir.action.act_window'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def __register__(cls, module_name):
|
||||||
|
super(IrActWindow, cls).__register__(module_name)
|
||||||
|
|
||||||
|
# migrate (6.0 --> 7.0): domain --> context_domain
|
||||||
|
records = cls.search([
|
||||||
|
('res_model', '=', 'cashbook_report.eval_line'),
|
||||||
|
('domain', '!=', None),
|
||||||
|
('context_domain', '=', None),
|
||||||
|
('context_model', '=', None)])
|
||||||
|
if records:
|
||||||
|
to_write = []
|
||||||
|
for record in records:
|
||||||
|
to_write.extend([
|
||||||
|
[record],
|
||||||
|
{
|
||||||
|
'context_domain': record.domain,
|
||||||
|
'domain': None,
|
||||||
|
}])
|
||||||
|
cls.write(*to_write)
|
||||||
|
|
||||||
|
# end IrActWindow
|
||||||
|
|
|
@ -788,8 +788,9 @@ class ReportTestCase(CashbookInvestmentTestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
evaluation.dashb_actwin.usage,
|
evaluation.dashb_actwin.usage,
|
||||||
'dashboard')
|
'dashboard')
|
||||||
|
self.assertEqual(evaluation.dashb_actwin.domain, None)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
evaluation.dashb_actwin.domain,
|
evaluation.dashb_actwin.context_domain,
|
||||||
'[["evaluation", "=", %d]]' % evaluation.id)
|
'[["evaluation", "=", %d]]' % evaluation.id)
|
||||||
# action-view
|
# action-view
|
||||||
self.assertEqual(evaluation.dashb_actview.sequence, 10)
|
self.assertEqual(evaluation.dashb_actview.sequence, 10)
|
||||||
|
|
Loading…
Reference in a new issue