콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1443 화면

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
2598
0
8월 24
1687
1
6월 24
1627
4
6월 25
2442