Merge lp:~santagada-proge/openobject-addons/6.1 into lp:openobject-addons/6.1

Proposed by Leonardo Santagada @ Proge.com.br
Status: Needs review
Proposed branch: lp:~santagada-proge/openobject-addons/6.1
Merge into: lp:openobject-addons/6.1
Diff against target: 55 lines (+13/-3)
3 files modified
account_voucher/account_voucher.py (+10/-0)
account_voucher/account_voucher_view.xml (+1/-1)
account_voucher/voucher_payment_receipt_view.xml (+2/-2)
To merge this branch: bzr merge lp:~santagada-proge/openobject-addons/6.1
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+123823@code.launchpad.net

Description of the change

proposal to fix bug 1043857

To post a comment you must log in.

Unmerged revisions

6967. By Leonardo Santagada

Fix for setting the correct period when changing companies

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2012-08-28 10:58:11 +0000
+++ account_voucher/account_voucher.py 2012-09-11 19:50:24 +0000
@@ -705,6 +705,16 @@
705 res[key].update(vals[key])705 res[key].update(vals[key])
706 return res706 return res
707707
708 def onchange_company_id(self, cr, uid, ids, company_id, date, context=None):
709 if context is None:
710 context ={}
711 ctx = context.copy()
712 ctx.update({'company_id': company_id})
713 period_pool = self.pool.get('account.period')
714 pids = period_pool.find(cr, uid, date, context=ctx)
715 if pids:
716 return {'value': {'period_id': pids[0]}}
717
708 def onchange_date(self, cr, uid, ids, date, currency_id, payment_rate_currency_id, amount, company_id, context=None):718 def onchange_date(self, cr, uid, ids, date, currency_id, payment_rate_currency_id, amount, company_id, context=None):
709 """719 """
710 @param date: latest value from user input for field date720 @param date: latest value from user input for field date
711721
=== modified file 'account_voucher/account_voucher_view.xml'
--- account_voucher/account_voucher_view.xml 2012-01-31 13:36:57 +0000
+++ account_voucher/account_voucher_view.xml 2012-09-11 19:50:24 +0000
@@ -47,7 +47,7 @@
47 <field name="journal_id" widget="selection" select="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>47 <field name="journal_id" widget="selection" select="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
48 <field name="type" required="1"/>48 <field name="type" required="1"/>
49 <field name="name" colspan="2"/>49 <field name="name" colspan="2"/>
50 <field name="company_id" widget="selection" groups="base.group_multi_company"/>50 <field name="company_id" widget="selection" on_change="onchange_company_id(company_id, date)" groups="base.group_multi_company"/>
51 <field name="reference" select="1"/>51 <field name="reference" select="1"/>
52 <field name="account_id" widget="selection" invisible="True"/>52 <field name="account_id" widget="selection" invisible="True"/>
53 </group>53 </group>
5454
=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml 2012-01-31 13:36:57 +0000
+++ account_voucher/voucher_payment_receipt_view.xml 2012-09-11 19:50:24 +0000
@@ -156,7 +156,7 @@
156 <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>156 <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
157 <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>157 <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
158 <field name="name" colspan="2" invisible="context.get('line_type', False)"/>158 <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
159 <field name="company_id" widget="selection" groups="base.group_multi_company"/>159 <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id, date)"/>
160 <field name="account_id"160 <field name="account_id"
161 widget="selection"161 widget="selection"
162 invisible="True"/>162 invisible="True"/>
@@ -309,7 +309,7 @@
309 <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>309 <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
310 <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>310 <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/>
311 <field name="name" colspan="2" invisible="context.get('line_type', False)"/>311 <field name="name" colspan="2" invisible="context.get('line_type', False)"/>
312 <field name="company_id" widget="selection" groups="base.group_multi_company"/>312 <field name="company_id" widget="selection" groups="base.group_multi_company" on_change="onchange_company_id(company_id, date)"/>
313 <field name="account_id"313 <field name="account_id"
314 widget="selection"314 widget="selection"
315 invisible="True"/>315 invisible="True"/>