Skip to content

Commit

Permalink
[IMP] account_product_fiscal_classification: add sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Oct 23, 2023
1 parent fb68462 commit 836e383
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class AccountProductFiscalClassification(models.Model):
_name = "account.product.fiscal.classification"
_description = "Fiscal Classification"
_order = "sequence, id"

name = fields.Char(required=True)

Expand All @@ -20,6 +21,8 @@ class AccountProductFiscalClassification(models.Model):
" Classification without removing it.",
)

sequence = fields.Integer(default=10)

company_id = fields.Many2one(
comodel_name="res.company",
string="Company",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class AccountProductFiscalClassificationTemplate(models.Model):
_name = "account.product.fiscal.classification.template"
_description = "Fiscal Classification Template"
_order = "sequence, id"

name = fields.Char(required=True, translate=True)

Expand All @@ -25,6 +26,8 @@ class AccountProductFiscalClassificationTemplate(models.Model):
" Classification Template without removing it.",
)

sequence = fields.Integer(default=10)

purchase_tax_ids = fields.Many2many(
comodel_name="account.tax.template",
relation="fiscal_classification_template_purchase_tax_rel",
Expand Down Expand Up @@ -69,4 +72,5 @@ def _prepare_fiscal_classification(self, company, taxes_ref):
"description": self.description,
"purchase_tax_ids": [(6, 0, purchase_tax_ids)],
"sale_tax_ids": [(6, 0, sale_tax_ids)],
"sequence": self.sequence,
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<field name="model">account.product.fiscal.classification</field>
<field name="arch" type="xml">
<tree decoration-muted="active == False">
<field name="sequence" widget="handle" />
<field name="name" />
<field name="purchase_tax_ids" widget="many2many_tags" />
<field name="sale_tax_ids" widget="many2many_tags" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<field name="model">account.product.fiscal.classification.template</field>
<field name="arch" type="xml">
<tree decoration-muted="active == False">
<field name="sequence" widget="handle" />
<field name="name" />
<field name="purchase_tax_ids" widget="many2many_tags" />
<field name="sale_tax_ids" widget="many2many_tags" />
Expand Down

0 comments on commit 836e383

Please sign in to comment.