Merge lp:~sebastien.beau/openobject-addons/openobject-addons-account-duplicate-tax into lp:openobject-addons/6.1

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Needs review
Proposed branch: lp:~sebastien.beau/openobject-addons/openobject-addons-account-duplicate-tax
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+9/-0)
1 file modified
account/account.py (+9/-0)
To merge this branch: bzr merge lp:~sebastien.beau/openobject-addons/openobject-addons-account-duplicate-tax
Reviewer Review Type Date Requested Status
qdp (OpenERP) Pending
OpenERP Core Team Pending
Review via email: mp+117897@code.launchpad.net

Description of the change

Fix this bug : https://bugs.launchpad.net/openobject-addons/+bug/1032196

If you try to duplicate an existing tax using the button 'duplicate' on the form view, OpenERP will raise an error.

Thanks for merging it.

To post a comment you must log in.

Unmerged revisions

6807. By Sébastien BEAU - http://www.akretion.com

[FIX] account : fix an error when trying to duplicate a tax

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-07-23 09:09:44 +0000
3+++ account/account.py 2012-08-02 14:10:29 +0000
4@@ -1852,6 +1852,15 @@
5 Ex: result=round(price_unit*0.21,4)
6 """
7
8+
9+ def copy(self, cr, uid, id, default=None, context=None):
10+ if not default:
11+ default = {}
12+ tax = self.browse(cr, uid, id, context=context)
13+ default['name'] = tax['name'] + ' (copy)'
14+ return super(account_tax, self).copy(cr, uid, id, default=default, context=context)
15+
16+
17 def get_precision_tax():
18 def change_digit_tax(cr):
19 res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, 'Account')