diff --git a/account_tax_code/__manifest__.py b/account_tax_code/__manifest__.py index 8072606d..161951ba 100644 --- a/account_tax_code/__manifest__.py +++ b/account_tax_code/__manifest__.py @@ -1,4 +1,4 @@ -# Copyright 2009-2018 Noviat. +# Copyright 2009-2019 Noviat. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { diff --git a/account_tax_code/models/account_tax.py b/account_tax_code/models/account_tax.py index 4e7a6a8b..44d17b0e 100644 --- a/account_tax_code/models/account_tax.py +++ b/account_tax_code/models/account_tax.py @@ -1,7 +1,7 @@ -# Copyright 2009-2018 Noviat. +# Copyright 2009-2019 Noviat. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import _, api, fields, models class AccountTax(models.Model): @@ -13,3 +13,9 @@ class AccountTax(models.Model): ('code_company_uniq', 'unique (code,company_id)', 'The code of the Tax must be unique per company !') ] + + @api.one + @api.returns('self', lambda value: value.id) + def copy(self, default=None): + default = dict(default or {}, code=_("%s (Copy)") % (self.code or '')) + return super().copy(default=default)