Skip to content

Commit

Permalink
[REF] document number fields in fiscal mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
mileo committed May 27, 2024
1 parent cbbef00 commit 7cda30b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 0 additions & 24 deletions l10n_br_fiscal/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand All @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions l10n_br_fiscal/models/document_fiscal_mixin_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit 7cda30b

Please sign in to comment.