From fc4cf42c7e49c51356c3bbb62fcf6357f66fd3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Sun, 26 May 2024 21:04:56 -0300 Subject: [PATCH] [REF] document number fields in fiscal mixin --- l10n_br_fiscal/models/document.py | 24 ------------------- .../models/document_fiscal_mixin_fields.py | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) 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 e6e09296d547..a468e95ca923 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, + )