Skip to content

Commit c790c89

Browse files
committed
[IMP] account_product_fiscal_classification: add sequence
1 parent fb68462 commit c790c89

4 files changed

+9
-0
lines changed

account_product_fiscal_classification/models/account_product_fiscal_classification.py

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
class AccountProductFiscalClassification(models.Model):
1010
_name = "account.product.fiscal.classification"
1111
_description = "Fiscal Classification"
12+
_order = "sequence, id"
1213

1314
name = fields.Char(required=True)
1415

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

24+
sequence = fields.Integer(sequence=10)
25+
2326
company_id = fields.Many2one(
2427
comodel_name="res.company",
2528
string="Company",

account_product_fiscal_classification/models/account_product_fiscal_classification_template.py

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
class AccountProductFiscalClassificationTemplate(models.Model):
99
_name = "account.product.fiscal.classification.template"
1010
_description = "Fiscal Classification Template"
11+
_order = "sequence, id"
1112

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

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

29+
sequence = fields.Integer(default=10)
30+
2831
purchase_tax_ids = fields.Many2many(
2932
comodel_name="account.tax.template",
3033
relation="fiscal_classification_template_purchase_tax_rel",
@@ -69,4 +72,5 @@ def _prepare_fiscal_classification(self, company, taxes_ref):
6972
"description": self.description,
7073
"purchase_tax_ids": [(6, 0, purchase_tax_ids)],
7174
"sale_tax_ids": [(6, 0, sale_tax_ids)],
75+
"sequence": self.sequence,
7276
}

account_product_fiscal_classification/views/view_account_product_fiscal_classification.xml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<field name="model">account.product.fiscal.classification</field>
1111
<field name="arch" type="xml">
1212
<tree decoration-muted="active == False">
13+
<field name="sequence" widget="handle" />
1314
<field name="name" />
1415
<field name="purchase_tax_ids" widget="many2many_tags" />
1516
<field name="sale_tax_ids" widget="many2many_tags" />

account_product_fiscal_classification/views/view_account_product_fiscal_classification_template.xml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<field name="model">account.product.fiscal.classification.template</field>
1414
<field name="arch" type="xml">
1515
<tree decoration-muted="active == False">
16+
<field name="sequence" widget="handle" />
1617
<field name="name" />
1718
<field name="purchase_tax_ids" widget="many2many_tags" />
1819
<field name="sale_tax_ids" widget="many2many_tags" />

0 commit comments

Comments
 (0)