openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #03946
[Merge] lp:~savoirfairelinux-openerp/openerp-canada/7.0-bug-missing-amount_in_word-proforma_voucher into lp:openerp-canada
Mathieu Benoit has proposed merging lp:~savoirfairelinux-openerp/openerp-canada/7.0-bug-missing-amount_in_word-proforma_voucher into lp:openerp-canada.
Requested reviews:
OpenERP Community Reviewer/Maintainer (openerp-community-reviewer)
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-canada/7.0-bug-missing-amount_in_word-proforma_voucher/+merge/207565
--
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-canada/7.0-bug-missing-amount_in_word-proforma_voucher/+merge/207565
Your team OpenERP Community Reviewer/Maintainer is requested to review the proposed merge of lp:~savoirfairelinux-openerp/openerp-canada/7.0-bug-missing-amount_in_word-proforma_voucher into lp:openerp-canada.
=== modified file 'l10n_ca_account_check_writing/account_voucher.py'
--- l10n_ca_account_check_writing/account_voucher.py 2013-06-11 12:24:41 +0000
+++ l10n_ca_account_check_writing/account_voucher.py 2014-02-20 22:49:12 +0000
@@ -81,7 +81,7 @@
supplier_context['lang'] = supplier_lang
currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=supplier_context)
amount_line = get_amount_line(amount, currency, supplier_lang)
- default['value'].update({'amount_in_word':amount_line})
+ default['value'].update({'amount_in_word': amount_line})
if journal_id:
allow_check_writing = self.pool.get('account.journal').browse(
cr, uid, journal_id, context=context).allow_check_writing
@@ -90,7 +90,7 @@
def print_check(self, cr, uid, ids, context=None):
if not ids:
- return {}
+ return {}
check_layout_report = {
'top': 'account.print.check.top',
@@ -114,6 +114,25 @@
'nodestroy': True
}
+ def proforma_voucher(self, cr, uid, ids, context=None):
+ # update all amount in word when perform a voucher
+ if type(context) is not dict:
+ context = {}
+ i_id = ids[0]
+ amount = self.browse(cr, uid, i_id, context=context).amount
+ supplier_lang = self.browse(cr, uid, i_id, context=context).partner_id.lang
+ supplier_context = context.copy()
+ # for some calls, such as the currency browse() call, we want to separate our user's
+ # language from our supplier's. That's why we need a separate context.
+ supplier_context['lang'] = supplier_lang
+ currency_id = self._get_current_currency(cr, uid, i_id, context)
+ currency = self.pool.get('res.currency').browse(cr, uid, currency_id, context=supplier_context)
+ # get the amount_in_word
+ amount_line = get_amount_line(amount, currency, supplier_lang)
+ self.write(cr, uid, [i_id], {'amount_in_word': amount_line})
+
+ return super(account_voucher, self).proforma_voucher(cr, uid, ids, context=context)
+
# By default, the supplier reference number is not so easily accessible from a voucher line because
# there's no direct link between the voucher and the invoice. Fortunately, there was this recently
# submitted patch from Lorenzo Battistini (Agile) BG at
@@ -125,7 +144,7 @@
def get_suppl_inv_num(self, cr, uid, move_line_id, context=None):
move_line = self.pool.get('account.move.line').browse(cr, uid, move_line_id, context)
- return (move_line.invoice and move_line.invoice.supplier_invoice_number or '')
+ return move_line.invoice and move_line.invoice.supplier_invoice_number or ''
def _get_supplier_invoice_number(self, cr, uid, ids, name, args, context=None):
res={}
=== modified file 'l10n_ca_qc_hr_payroll/l10n_ca_qc_hr_payroll_data.xml'
--- l10n_ca_qc_hr_payroll/l10n_ca_qc_hr_payroll_data.xml 2013-03-08 15:20:04 +0000
+++ l10n_ca_qc_hr_payroll/l10n_ca_qc_hr_payroll_data.xml 2014-02-20 22:49:12 +0000
@@ -309,7 +309,7 @@
<field name="name">QPP - Employer Contribution (QPPERC)</field>
<field name="sequence" eval="138"/>
<field name="code">QPPERC</field>
- <field name="category_id" ref="hr_payroll.DED"/>
+ <field name="category_id" ref="l10n_ca_hr_payroll.EMP"/>
<field name="appears_on_payslip" eval="0"/>
<field name="active" eval="1"/>
<field name="condition_select">none</field>
=== modified file 'l10n_ca_qc_hr_payroll_account/__openerp__.py'
--- l10n_ca_qc_hr_payroll_account/__openerp__.py 2013-02-27 20:02:47 +0000
+++ l10n_ca_qc_hr_payroll_account/__openerp__.py 2014-02-20 22:49:12 +0000
@@ -47,7 +47,7 @@
'data': [
'l10n_ca_qc_hr_payroll_account_data.xml',
],
- 'test': [],
+ 'test': ['test/l10n_ca_qc_hr_payroll_account.yml'],
'demo': [],
'installable': True,
'active': False,
=== added directory 'l10n_ca_qc_hr_payroll_account/test'
=== added file 'l10n_ca_qc_hr_payroll_account/test/l10n_ca_qc_hr_payroll_account.yml'
--- l10n_ca_qc_hr_payroll_account/test/l10n_ca_qc_hr_payroll_account.yml 1970-01-01 00:00:00 +0000
+++ l10n_ca_qc_hr_payroll_account/test/l10n_ca_qc_hr_payroll_account.yml 2014-02-20 22:49:12 +0000
@@ -0,0 +1,10 @@
+-
+ Check salary rule "QPP - Employer Contribution (QPPERC)", it's supposed to be
+ define in category "Employer Contribution".
+ https://bugs.launchpad.net/openerp-canada/+bug/1213406
+-
+ !python {model: hr.salary.rule}: |
+ rule_id = ref('l10n_ca_qc_hr_payroll.rule_qc_qpp_er_c')
+ rule = self.browse(cr, uid, rule_id)
+ category_id = ref('l10n_ca_hr_payroll.EMP')
+ assert (rule.category_id.id == category_id), "Expected the category Employer Contribution"