跳至內容
選單
此問題已被標幟
1 回覆
1422 瀏覽次數

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.

頭像
捨棄
作者 最佳答案

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
8月 24
4
2
6月 25
2562
0
8月 24
1658
1
6月 24
1618
4
6月 25
2398