Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][l10n_br_fiscal][REF] l10n_br_fiscal: factored landed cost code - fwp 3529 #3518

Draft
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

rvalyi
Copy link
Member

@rvalyi rvalyi commented Dec 2, 2024

forward port de #3529

@rvalyi rvalyi marked this pull request as draft December 2, 2024 16:39
@OCA-git-bot
Copy link
Contributor

Hi @renatonlima,
some modules you are maintaining are being modified, check this out!

@rvalyi rvalyi force-pushed the 16.0-fiscal-landed-cost branch from df1ee27 to e3a68b1 Compare December 8, 2024 17:49
@rvalyi rvalyi changed the title [16.0][l10n_br_fiscal][REF] l10n_br_fiscal: factored landed cost code [16.0][l10n_br_fiscal][REF] l10n_br_fiscal: factored landed cost code - fwp 3529 Dec 8, 2024
@rvalyi rvalyi marked this pull request as ready for review December 8, 2024 17:52
@rvalyi
Copy link
Member Author

rvalyi commented Dec 8, 2024

cc @antoniospneto @mileo

@antoniospneto
Copy link
Contributor

um teste falhou:

2024-12-08 17:56:03,601 403 ERROR odoo odoo.addons.l10n_br_stock_account.tests.test_invoicing_picking: ERROR: InvoicingPickingTest.test_fields_freight_insurance_other_costs
Traceback (most recent call last):
  File "/__w/l10n-brazil/l10n-brazil/l10n_br_stock_account/tests/test_invoicing_picking.py", line 447, in test_fields_freight_insurance_other_costs
    picking.amount_freight_value = 9.0
  File "/opt/odoo/odoo/fields.py", line 1325, in __set__
    records.write({self.name: write_value})
  File "/opt/odoo/addons/stock/models/stock_picking.py", line 827, in write
    res = super(Picking, self).write(vals)
  File "/opt/odoo/addons/mail/models/mail_thread.py", line 315, in write
    result = super(MailThread, self).write(values)
  File "/opt/odoo/addons/mail/models/mail_activity_mixin.py", line 241, in write
    return super(MailActivityMixin, self).write(vals)
  File "/opt/odoo/odoo/models.py", line 3817, in write
    fields[0].determine_inverse(real_recs)
  File "/opt/odoo/odoo/fields.py", line 1401, in determine_inverse
    determine(self.inverse, records)
  File "/opt/odoo/odoo/fields.py", line 98, in determine
    return needle(*args)
  File "/__w/l10n-brazil/l10n-brazil/l10n_br_fiscal/models/document_mixin_methods.py", line 201, in _inverse_amount_freight
    return self._inverse_amount_landed_cost("freight_value")
  File "/__w/l10n-brazil/l10n-brazil/l10n_br_fiscal/models/document_mixin_methods.py", line 196, in _inverse_amount_landed_cost
    record.move_ids.invoice_line_ids._onchange_price_subtotal()
AttributeError: 'account.move.line' object has no attribute '_onchange_price_subtotal'

@rvalyi rvalyi force-pushed the 16.0-fiscal-landed-cost branch from e3a68b1 to 84de5bb Compare December 9, 2024 19:37
@rvalyi rvalyi marked this pull request as draft December 10, 2024 13:51
@rvalyi
Copy link
Member Author

rvalyi commented Dec 10, 2024

@marcelsavegnago @antoniospneto @DiegoParadeda eu botei o PR em rascunho de volta, pois no ultimo force-push eu amendei o commit b259649
para não chamar mais os onchanges jà que na v16 não são mais necessários (os campos tem compute e esses onchange nem existem mais) porem ainda assim esse código que era para resolver #3484 na v14 não vai se aplicar com os modulos sale e point_of_sale porque não tem mais esse _amount_all no modulo sale:

                if (
                    record._fields[name].compute == "_amount_all"
                    and not record._fields[name].inverse
                ):

Ao mesmo tempo eu ainda não testei, mas talvez isso nem seria necessário na v16, tem que testar...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants