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

account_move_template error V.17 #1891

Open
C2dricLeroy opened this issue May 30, 2024 · 1 comment · Fixed by #1930
Open

account_move_template error V.17 #1891

C2dricLeroy opened this issue May 30, 2024 · 1 comment · Fixed by #1930
Labels

Comments

@C2dricLeroy
Copy link

Module

account_move_template

Describe the bug

Error while using wizard.

To Reproduce

Odoo v17, V17 module from there

Steps to reproduce the behavior:

  1. Create a template
  2. Open "Accounting / Actions" --> "Create Entry From Template"
  3. Fill the field until pressing "Create Journal Entry"

Expected behavior
The module should create a Jouyrnal Entry from the template.

Error

File "/opt/odoo/extra_addons/account_move_template/wizard/account_move_template_run.py", line 213, in _prepare_move_line
    pterm_list = line.payment_term_id.compute(value=1, date_ref=self.date)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'account.payment.term' object has no attribute 'compute'
File "/opt/odoo/extra_addons/account_move_template/wizard/account_move_template_run.py", line 213, in _prepare_move_line
    pterm_list = line.payment_term_id.compute(value=1, date_ref=self.date)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'account.payment.term' object has no attribute 'compute'

You can find this line in account_move_template_run.py line213.

Since this commit Odoo change the .compute method.

Moreover, later in the code there is a weird thing.
The tax_repartition string is set and then a search is perform.

            atrl_ids = self.env["account.tax.repartition.line"].search(
                [
                    (tax_repartition, "in", line.tax_ids.ids),
                    ("repartition_type", "=", "base"),
                ]
            )

This result to ```("invoice_tax_id", "in", [5]) in my case

@C2dricLeroy C2dricLeroy changed the title account_move_template account_move_template error V.17 May 30, 2024
@C2dricLeroy
Copy link
Author

C2dricLeroy commented Jun 5, 2024

Code correction is here, I will try to work on unit tests.

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