savoirfairelinux-openerp team mailing list archive
-
savoirfairelinux-openerp team
-
Mailing list archive
-
Message #00089
lp:~savoirfairelinux-openerp/openerp-canada/6.1-bug-1178696-l10n_ca_account_check_writing into lp:openerp-canada/6.1
Joao Alfredo Gama Batista has proposed merging lp:~savoirfairelinux-openerp/openerp-canada/6.1-bug-1178696-l10n_ca_account_check_writing into lp:openerp-canada/6.1.
Requested reviews:
OpenERP Community Reviewer (openerp-community-reviewer)
Related bugs:
Bug #1178696 in OpenERP Canada: "[6.1/7.0] l10n_ca_account_check_writing: Wrong currency in value as word"
https://bugs.launchpad.net/openerp-canada/+bug/1178696
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-canada/6.1-bug-1178696-l10n_ca_account_check_writing/+merge/163353
Force 'Canadian Dollars' as default currency for the canadian checks.
--
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-canada/6.1-bug-1178696-l10n_ca_account_check_writing/+merge/163353
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-canada/6.1-bug-1178696-l10n_ca_account_check_writing.
=== modified file 'l10n_ca_account_check_writing/account_voucher.py'
--- l10n_ca_account_check_writing/account_voucher.py 2013-04-25 21:02:28 +0000
+++ l10n_ca_account_check_writing/account_voucher.py 2013-05-10 18:32:28 +0000
@@ -20,11 +20,33 @@
##############################################################################
from openerp.osv import orm, fields
-
+from openerp.tools.amount_to_text_en import amount_to_text
class account_voucher(orm.Model):
_inherit = 'account.voucher'
+ def onchange_amount(self, cr, uid, ids, amount, rate, partner_id,
+ journal_id, currency_id, ttype, date,
+ payment_rate_currency_id, company_id, context=None):
+ """ Inherited - add amount_in_word and allow_check_writting in returned value dictionary """
+ if not context:
+ context = {}
+ default = super(account_voucher, self).onchange_amount(
+ cr, uid, ids, amount, rate, partner_id, journal_id, currency_id,
+ ttype, date, payment_rate_currency_id, company_id, context=context)
+ if 'value' in default:
+ amount = 'amount' in default['value'] and default['value']['amount'] or amount
+
+ #TODO : generic amount_to_text is not ready yet, otherwise language (and country) and currency can be passed
+ #amount_in_word = amount_to_text(amount, context=context)
+ amount_in_word = amount_to_text(amount, currency='Canadian Dollars')
+ default['value'].update({'amount_in_word':amount_in_word})
+ if journal_id:
+ allow_check_writing = self.pool.get('account.journal').browse(
+ cr, uid, journal_id, context=context).allow_check_writing
+ default['value'].update({'allow_check': allow_check_writing})
+ return default
+
def print_check(self, cr, uid, ids, context=None):
if not ids:
return {}
=== modified file 'l10n_ca_account_check_writing/report/l10n_ca_check_print.py'
--- l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2013-04-25 22:22:38 +0000
+++ l10n_ca_account_check_writing/report/l10n_ca_check_print.py 2013-05-10 18:32:28 +0000
@@ -36,7 +36,7 @@
'fill_stars' : self.fill_stars,
})
def fill_stars(self, amount):
- amount = amount.replace('Dollars','')
+ #amount = amount.replace('Dollars','')
if len(amount) < 90:
stars = 90 - len(amount)
return ' '.join([amount,'*'*stars])
Follow ups