Skip to Content
Menú
This question has been flagged
1 Respondre
1271 Vistes

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
Descartar
Autor Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
0
d’ag. 24
4
2
de juny 25
2236
0
d’ag. 24
1526
1
de juny 24
1524
4
de juny 25
2090