Hello,
Iâm struggling to add some data that I need to my Invoice reportâ¦
In Delivery Slip(Tech name: stock.picking.list.out) I get the Invoice
Address from [[ display_address(picking.partner_invoice_id.parent_id) ]]
and Delivery Address from [[ display_address(picking.partner_shipping_id) ]]
Iâd like to use same information in my Invoice(Tech name: account.invoice) template,
but the invoice object does not contain the Invoice and Delivery addresses. It has only
display_address(o.partner_id), which is not the one that I need for my invoice document.
I found a nice mapping table in the database âsale_order_invoice_relâ and managed to
build a SQL query that does what I need, but I canât figure out how to perform the same thing
in the invoice report, when I modify it with Open Office. My query is
SELECT
account_invoice.id,
sale_order.partner_id,
sale_order.partner_invoice_id,
sale_order.partner_shipping_id
FROM
public.sale_order_invoice_rel,
public.sale_order,
public.account_invoice
WHERE
sale_order_invoice_rel.order_id = sale_order.id AND
account_invoice.id = sale_order_invoice_rel.invoice_id;
and it returns what I need⦠for example:
âid ;partner_id; partner_invoice_id; partner_shipping_id
1;5;6;7â
Question is how do I get those IDs in the Invoice template via RML tags or where can I extend a python method, that is being used to provide to the template this o object that contains the invoice dataâ¦
I found invoice_print method in account.account_invoice, that according to the comment should be âThis function prints the invoice and mark it as sent, so that we can see more easily the next step of the workflowâ, but not sure how to extend it â it doesnât return this o object, so that I could extend itâ¦
If youâve done something similar please tell me how it worked for you.
Can I somehow modify the report or extend the python code and which method?
Best Regards,
Pavel Pavlov