Merge lp:~therp-nl/therp-backports/addons-6.1-lp999315-fix_recurring_model_set_company into lp:therp-backports

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 6691
Proposed branch: lp:~therp-nl/therp-backports/addons-6.1-lp999315-fix_recurring_model_set_company
Merge into: lp:therp-backports
Diff against target: 31 lines (+9/-1)
2 files modified
account/account.py (+8/-0)
account/account_view.xml (+1/-1)
To merge this branch: bzr merge lp:~therp-nl/therp-backports/addons-6.1-lp999315-fix_recurring_model_set_company
Reviewer Review Type Date Requested Status
Therp Pending
Review via email: mp+130553@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Backport of OpenERP's fix in 7.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2012-08-28 07:48:35 +0000
3+++ account/account.py 2012-10-19 14:09:34 +0000
4@@ -2319,6 +2319,14 @@
5
6 return move_ids
7
8+ def onchange_journal_id(self, cr, uid, ids, journal_id, context=None):
9+ company_id = False
10+ if journal_id:
11+ journal = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context)
12+ if journal.company_id.id:
13+ company_id = journal.company_id.id
14+ return {'value': {'company_id': company_id}}
15+
16 account_model()
17
18 class account_model_line(osv.osv):
19
20=== modified file 'account/account_view.xml'
21--- account/account_view.xml 2012-05-28 06:02:51 +0000
22+++ account/account_view.xml 2012-10-19 14:09:34 +0000
23@@ -1703,7 +1703,7 @@
24 <filter string="Purchase" icon="terp-purchase" domain="[('journal_id.type', '=', 'purchase')]"/>
25 <separator orientation="vertical"/>
26 <field name="name"/>
27- <field name="journal_id" widget="selection"/>
28+ <field name="journal_id" on_change="onchange_journal_id(journal_id)"/>
29 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
30 </group>
31 <newline/>

Subscribers

People subscribed via source and target branches

to all changes: