diff --git a/l10n_br_fiscal/models/document.py b/l10n_br_fiscal/models/document.py index de7e82a83e98..9b3f40341f5e 100644 --- a/l10n_br_fiscal/models/document.py +++ b/l10n_br_fiscal/models/document.py @@ -72,23 +72,12 @@ class Document(models.Model): store=True, ) - document_number = fields.Char( - copy=False, - index=True, - ) - rps_number = fields.Char( string="RPS Number", copy=False, index=True, ) - document_key = fields.Char( - string="Key", - copy=False, - index=True, - ) - document_date = fields.Datetime( copy=False, ) @@ -100,10 +89,6 @@ class Document(models.Model): default=lambda self: self.env.user, ) - document_type_id = fields.Many2one( - comodel_name="l10n_br_fiscal.document.type", - ) - operation_name = fields.Char( copy=False, ) @@ -119,15 +104,6 @@ class Document(models.Model): copy=False, ) - document_serie_id = fields.Many2one( - comodel_name="l10n_br_fiscal.document.serie", - domain="[('active', '=', True)," "('document_type_id', '=', document_type_id)]", - ) - - document_serie = fields.Char( - string="Serie Number", - ) - document_related_ids = fields.One2many( comodel_name="l10n_br_fiscal.document.related", inverse_name="document_id", diff --git a/l10n_br_fiscal/models/document_fiscal_mixin_fields.py b/l10n_br_fiscal/models/document_fiscal_mixin_fields.py index 90287bb1f6cf..f8f791335b96 100644 --- a/l10n_br_fiscal/models/document_fiscal_mixin_fields.py +++ b/l10n_br_fiscal/models/document_fiscal_mixin_fields.py @@ -443,3 +443,27 @@ def _operation_domain(self): ) force_compute_delivery_costs_by_total = fields.Boolean(default=False) + + document_type_id = fields.Many2one( + comodel_name="l10n_br_fiscal.document.type", + ) + + document_serie_id = fields.Many2one( + comodel_name="l10n_br_fiscal.document.serie", + domain="[('active', '=', True)," "('document_type_id', '=', document_type_id)]", + ) + + document_serie = fields.Char( + string="Serie Number", + ) + + document_number = fields.Char( + copy=False, + index=True, + ) + + document_key = fields.Char( + string="Key", + copy=False, + index=True, + )