Skip to content

Commit

Permalink
Remove authority when making copies of taxes and tax rules
Browse files Browse the repository at this point in the history
  • Loading branch information
cdchapman committed Aug 15, 2024
1 parent 6aae0a3 commit 55ca525
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ class Tax(metaclass=PoolMeta):
], "Rate Type", sort=False, states={
'readonly': _states['readonly'],
})
del _states

@classmethod
def copy(cls, taxes, default=None):
if default is None:
default = {}
else:
default = default.copy()
default.setdefault('authority', None)
return super().copy(taxes, default=default)

class TaxBoundary(ModelView, ModelSQL, MatchMixin):
"Tax Boundary"
Expand Down Expand Up @@ -71,3 +81,12 @@ class TaxRule(metaclass=PoolMeta):
jurisdiction = fields.Many2One('census.place', "Jurisdiction",
help="The tax jurisdiction represented by this rule")

@classmethod
def copy(cls, rules, default=None):
if default is None:
default = {}
else:
default = default.copy()
default.setdefault('authority', None)
return super().copy(rules, default=default)

0 comments on commit 55ca525

Please sign in to comment.