Commit d780f947 authored by David Beal's avatar David Beal Committed by Denis Ledoux
Browse files

[FIX] res.currency: allow duplication

Currencies must be unique per company.
Therefore, without this revision, adding `(Copy)`
to the currency name on duplication, this
is simply not possible to duplicate a currency.

Closes #2443
parent f27acff1
......@@ -134,6 +134,16 @@ class res_currency(osv.osv):
reads =, uid, ids, ['name','symbol'], context=context, load='_classic_write')
return [(x['id'], tools.ustr(x['name'])) for x in reads]
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
if not default:
default = {}
default.update(name=_("%s (copy)")
% (self.browse(cr, uid, id, context=context).name))
return super(res_currency, self).copy(
cr, uid, id, default=default, context=context)
def round(self, amount):
""" Return `amount` rounded according to currency `self`. """
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment