Skip to Content
Menu
This question has been flagged
3 Replies
9530 Views

I want to change the report behind this button:



Behind that button is the "point_of_sale.report_invoice".

Now I want to change that, that another report is printed out.

What is the best way to do that?


How can I add this to the invoice in pos ?


Thank you

Avatar
Discard
Best Answer

To replace default invoice report in POS, you need to extend "push_and_invoice_order" function of models.js file in point_of_sale and replace following code:

self.chrome.do_action('pos_custom_module.custom_report_id',{additional_context:{active_ids:order_server_id,}});


Avatar
Discard
Author

hello, thank you for your fast answer, when I change it to this with the name of my own report, the old invoice report is still printed out:

self.chrome.do_action('own_report',{additional_context:{active_ids:order_server_id,}});

Will you please check with new POS Session?

Author

same problem...

Best Answer

Hi Wizards,

To change the default report into another one, you can make change in the original code or you can do it by a custom module,

if you are looking to change it by custom module then you can do it as follows, you can mention the new report name at

<field name="report_name">module_name.report_id</field>
<record id="point_of_sale.pos_invoice_report" model="ir.actions.report.xml">
<field name="name">Invoice</field>
<field name="model">pos.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.report_id</field>
</record>

if you are going to do it in original code, then point of sale -> views -> point_of_sale_report.xml then you can change the record in the id "pos_invoice_report" like this.

<record id="pos_invoice_report" model="ir.actions.report.xml">
<field name="name">Invoice</field>
<field name="model">pos.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.report_id</field>
</record>
Avatar
Discard
Author

hi, thank you for the fast answer.

when I try to change that to my own report, I get an error.

Is this because my report comes not from the point_of_sale module?:

In Odoo9 :

<report

id="pos_invoice_report"

string="Invoice"

model="pos.order"

report_type="qweb-pdf"

name="own_report"

file="own_report"

/>

hi, what error you got ? you have to mention the report name as module_name.report_id

Author

and what if the report doesn't come from a module, I made that directly in odoo xml reports?

So you created the report from the user interface, to get the external id of that report you can activate the developer mode then , go to settings-> technical->reports -> reports , then select the report, then from the lady debug button (button in top menu bar near logged in user) select view meta data, on clicking it you will get the id of the report from XML ID, give this id

Author

yes but my problem is, that I don't have any xml ID

Did you checked the way i have mentioned above to get XML ID?

Author

the problem is that this report doesn't have any xml id , because it's made with aeroo reports

@Niyas I changed the report_name as you mentioned above but when I try to print the report from POS, a message is shown, saying that I should print the invoice from the backend. Any idea what may be causing this?

@Niyas I forgot to mention, I am using odoo 12

Best Answer

hello sir how can i keep highlighted the invoice button in pos payment screen 

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 20
2319
0
Jul 15
2540
1
Sep 21
3292
1
Sep 24
5256
1
Sep 17
5447