This question has been flagged
1 Reply
2198 Views

Can we combine account_payment and account_move  into one dictionary?


for ex:

First, created an entry in Bank(INR) journal through the account_payment model.

Second, created an entry in Bank(INR) journal through the account_move model.

Then I needed to print all entries created against Bank(INR) journal as pdf. 

How should I combine all entries created in both models? Or how can I print all these entries

as a pdf file? 

Avatar
Discard
Best Answer

Hi,

From the report parser, you can prepare the dictionary from these models and return into the template. Using the Search method search data from both models and iterate over a for loop and append into a dictionary and return it to the template.

For Reference : How To Call A Python Function While Printing PDF Report in Odoo

Thanks

Avatar
Discard
Author

How to sort this dictionary based on date?

<tr t-foreach="journal_list.sorted(key=lambda k: k['date'])" t-as="ap">

but not working