Merge lp:~mukunde/unifield-server/US-8169 into lp:unifield-server

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~mukunde/unifield-server/US-8169
Merge into: lp:unifield-server
Diff against target: 75 lines (+8/-6)
3 files modified
bin/addons/account_mcdb/account_mcdb.py (+1/-1)
bin/addons/account_mcdb/account_view.xml (+4/-4)
bin/osv/fields.py (+3/-1)
To merge this branch: bzr merge lp:~mukunde/unifield-server/US-8169
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+424510@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account_mcdb/account_mcdb.py'
2--- bin/addons/account_mcdb/account_mcdb.py 2019-09-26 12:44:53 +0000
3+++ bin/addons/account_mcdb/account_mcdb.py 2022-06-13 12:48:12 +0000
4@@ -52,7 +52,7 @@
5 'account_ids': fields.many2many(obj='account.account', rel='account_account_mcdb', id1='mcdb_id', id2='account_id', string="Account Code"),
6 'partner_id': fields.many2one('res.partner', string="Partner"), # not used since US-3427
7 'partner_ids': fields.many2many(obj='res.partner', rel='partner_mcdb', id1='mcdb_id', id2='partner_id',
8- string='Partners', order_by='name, id'),
9+ string='Partners', order_by='name, id', display_inactive=True),
10 'employee_id': fields.many2one('hr.employee', string="Employee"), # not used since US-3427
11 'employee_ids': fields.many2many(obj='hr.employee', rel='employee_mcdb', id1='mcdb_id', id2='employee_id',
12 string='Employees', order_by='employee_type, identification_id, id'),
13
14=== modified file 'bin/addons/account_mcdb/account_view.xml'
15--- bin/addons/account_mcdb/account_view.xml 2022-01-19 15:47:14 +0000
16+++ bin/addons/account_mcdb/account_view.xml 2022-06-13 12:48:12 +0000
17@@ -162,7 +162,7 @@
18 </group>
19 <newline/>
20 <group>
21- <field name="partner_id" select='1' string="3RD Party Partner"/>
22+ <field name="partner_id" select='1' string="3RD Party Partner" context="{'show_button_show_inactive': True}"/>
23 <field name="employee_id" select='1' string="3RD Party Employee"/>
24 <field name="transfer_journal_id" select='1' string="3RD Party Journal"
25 context="{'exclude_journals': ['IB'], 'search_default_filter_is_active': 1}"/>
26@@ -189,7 +189,7 @@
27 </group>
28 <newline/>
29 <group expand="0" string="Group By..." colspan="4" col="20">
30- <filter string="3rd party Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
31+ <filter string="3rd party Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id', 'show_button_show_inactive': True}"/>
32 <filter string="3rd party Employee" icon="terp-personal-" domain="[]" context="{'group_by': 'employee_id'}"/>
33 <filter string="3rd party Journal" icon="terp-dolar" domain="[]" context="{'group_by': 'transfer_journal_id', 'exclude_journals': ['IB']}"/>
34 <separator orientation="vertical"/>
35@@ -354,7 +354,7 @@
36 </group>
37 <newline/>
38 <group col='8' colspan='4'>
39- <field name="partner_id" select="1" string="3RD Party Partner"/>
40+ <field name="partner_id" select="1" string="3RD Party Partner" context="{'show_button_show_inactive': True}"/>
41 <field name="employee_id" select="1" string="3RD Party Employee"/>
42 <field name="transfer_journal_id" select="1" string="3RD Party Journal"
43 context="{'exclude_journals': ['IB'], 'search_default_filter_is_active': 1}"/>
44@@ -367,7 +367,7 @@
45 </group>
46 <newline/>
47 <group expand="0" string="Group By..." colspan="12" col="10">
48- <filter string="3rd party Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
49+ <filter string="3rd party Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id', 'show_button_show_inactive': True}"/>
50 <filter string="3rd party Employee" icon="terp-personal-" domain="[]" context="{'group_by': 'employee_id'}"/>
51 <filter string="3rd party Journal" icon="terp-dolar" domain="[]" context="{'group_by': 'transfer_journal_id'}"/>
52 <separator orientation="vertical"/>
53
54=== modified file 'bin/osv/fields.py'
55--- bin/osv/fields.py 2021-12-30 15:59:43 +0000
56+++ bin/osv/fields.py 2022-06-13 12:48:12 +0000
57@@ -592,6 +592,7 @@
58 _prefetch = False
59 _type = 'many2many'
60 def __init__(self, obj, rel, id1, id2, string='unknown', limit=None, **args):
61+ self.display_inactive = False
62 _column.__init__(self, string=string, **args)
63 self._obj = obj
64 if '.' in rel:
65@@ -625,9 +626,10 @@
66 # FIXME: make this distinction explicit in API!
67 domain = isinstance(self._domain, list) and self._domain or []
68
69- wquery = obj._where_calc(cr, user, domain, context=context)
70+ wquery = obj._where_calc(cr, user, domain, active_test=not self.display_inactive, context=context)
71 obj._apply_ir_rules(cr, user, wquery, 'read', context=context)
72 from_c, where_c, where_params = wquery.get_sql()
73+
74 if where_c:
75 where_c = ' AND ' + where_c
76

Subscribers

People subscribed via source and target branches