[ADD] field sequence
This commit is contained in:
parent
6b8e5883cb
commit
eab1d3b77a
@ -10,3 +10,4 @@ class ContractField(models.Model):
|
|||||||
string="Technical Name", help="Name uses in template", required=True,
|
string="Technical Name", help="Name uses in template", required=True,
|
||||||
)
|
)
|
||||||
description = fields.Char(string="Description", translate=True, default="",)
|
description = fields.Char(string="Description", translate=True, default="",)
|
||||||
|
sequence = fields.Integer(string="Sequence",)
|
||||||
|
@ -5,6 +5,7 @@ import logging
|
|||||||
from odoo import _, api, fields, models
|
from odoo import _, api, fields, models
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
from ..utils import MODULE_NAME
|
||||||
from ..utils.docxtpl import get_document_from_values_stream
|
from ..utils.docxtpl import get_document_from_values_stream
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@ -97,7 +98,7 @@ class ContractWizard(models.TransientModel):
|
|||||||
.id,
|
.id,
|
||||||
0,
|
0,
|
||||||
)
|
)
|
||||||
for field, value in sorted(contract_context_values.items())
|
for field, value in sorted(contract_context_values.items(), key=lambda tpl: self.env.ref("{}.contract_field_{}".format(MODULE_NAME, tpl[0])).sequence)
|
||||||
]
|
]
|
||||||
|
|
||||||
# Set up template domain
|
# Set up template domain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user