Skip to content

Commit

Permalink
[11.0][IMP]copy on tax code
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-demeyer committed Nov 12, 2019
1 parent 91d59c2 commit 2d65891
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion account_tax_code/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2009-2018 Noviat.
# Copyright 2009-2019 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
Expand Down
10 changes: 8 additions & 2 deletions account_tax_code/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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)

0 comments on commit 2d65891

Please sign in to comment.