Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
1064 Weergaven

Good evening,

I am trying to create a function that will use Odoo's default func" from l10n_account_customer_statements/models/res_partner.py to populate the 'l10n_account_customer_statements.action_customer_statements_report' and send it via email to the customer. Also, the rows in the table from the statement are not being populated.

For some reason, I cannot correctly populate the XML file, and it prints out empty without filling in the table. I am having trouble with the following:

The action_print_customer_statements return:


My code: I should note that we are in a wizard, and the `partner_ids` are being added by the user.

Avatar
Annuleer
Auteur Beste antwoord

I have solved the issue with the following changes.



More detailed:





Explanation


  • lines_data Dictionary:
    • We initialize an empty dictionary lines_data to store the lines for each partner.


  • Loop Through Partners:
    • ​We loop through self.partner_ids to process each partner. Inside the loop:
      • We extract the specific lines data for the partner from action['data']['lines'] using
      • We extract the specific lines data for the partner from action['data']['lines'] using as the key.

  • Pass lines_data to the Template:
    • Finally, we pass the lines_data dictionary along with other data to the report template through the data dictionary.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 24
4
1
sep. 24
1734
0
aug. 24
1231
1
jun. 24
1366
4
jun. 25
1619