Skip to content

account_move_template error V.17 #1891

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

Closed
C2dricLeroy opened this issue May 30, 2024 · 2 comments · Fixed by #1930
Closed

account_move_template error V.17 #1891

C2dricLeroy opened this issue May 30, 2024 · 2 comments · Fixed by #1930
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.

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.

Copy link

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 30, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
1 participant