Skip to content

Commit

Permalink
Merge PR #3307 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed Aug 27, 2024
2 parents d1cbb90 + 55d97d4 commit 328fa42
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _inject_shadowed_fields(self, vals_list):
for vals in vals_list:
for field in self._shadowed_fields():
if field in vals:
vals["fiscal_%s" % (field,)] = vals[field]
vals["fiscal_proxy_%s" % (field,)] = vals[field]

def ensure_one_doc(self):
self.ensure_one()
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _inject_shadowed_fields(self, vals_list):
for vals in vals_list:
for field in self._shadowed_fields():
if field in vals:
vals["fiscal_%s" % (field,)] = vals[field]
vals["fiscal_proxy_%s" % (field,)] = vals[field]

@api.model_create_multi
def create(self, vals_list):
Expand Down
8 changes: 4 additions & 4 deletions l10n_br_account/models/fiscal_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ class FiscalDocument(models.Model):
# proxy fields to enable writing the related (shadowed) fields
# to the fiscal document from the account.move through the _inherits system
# despite they have the same names.
fiscal_partner_id = fields.Many2one(
fiscal_proxy_partner_id = fields.Many2one(
string="Fiscal Partner",
related="partner_id",
readonly=False,
)
fiscal_company_id = fields.Many2one(
fiscal_proxy_company_id = fields.Many2one(
string="Fiscal Company",
related="company_id",
readonly=False,
)
fiscal_currency_id = fields.Many2one(
fiscal_proxy_currency_id = fields.Many2one(
string="Fiscal Currency",
related="currency_id",
readonly=False,
)
fiscal_user_id = fields.Many2one(
fiscal_proxy_user_id = fields.Many2one(
string="Fiscal User",
related="user_id",
readonly=False,
Expand Down
8 changes: 4 additions & 4 deletions l10n_br_account/models/fiscal_document_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ class FiscalDocumentLine(models.Model):
# proxy fields to enable writing the related (shadowed) fields
# to the fiscal doc line from the aml through the _inherits system
# despite they have the same names.
fiscal_name = fields.Text(
fiscal_proxy_name = fields.Text(
string="Fiscal Name",
related="name",
readonly=False,
)
fiscal_product_id = fields.Many2one(
fiscal_proxy_product_id = fields.Many2one(
string="Fiscal Product",
related="product_id",
readonly=False,
)
fiscal_quantity = fields.Float(
fiscal_proxy_quantity = fields.Float(
string="Fiscal Quantity",
related="quantity",
readonly=False,
)
fiscal_price_unit = fields.Float(
fiscal_proxy_price_unit = fields.Float(
string="Fiscal Price Unit",
related="price_unit",
readonly=False,
Expand Down
5 changes: 4 additions & 1 deletion l10n_br_delivery/models/fiscal_document_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def _get_default_incoterm(self):
" transactions.",
)

fiscal_incoterm_id = fields.Many2one(related="incoterm_id")
# proxy fields to enable writing the related (shadowed) fields
# to the fiscal doc line from the aml through the _inherits system
# despite they have the same names.
fiscal_proxy_incoterm_id = fields.Many2one(related="incoterm_id")

carrier_id = fields.Many2one(
comodel_name="delivery.carrier",
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_sale/models/fiscal_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FiscalDocument(models.Model):
# proxy field used to handle partner_shipping_id
# in l10n_br_fiscal.document while the sale module
# also brings a partner_shipping_id field to account.move.
fiscal_partner_shipping_id = fields.Many2one(
fiscal_proxy_partner_shipping_id = fields.Many2one(
string="Fiscal Partner Shipping",
related="partner_shipping_id",
readonly=False,
Expand Down

0 comments on commit 328fa42

Please sign in to comment.