I'm new to Odoo, so I want to hear suggestions from you guys please.
For some reasons we want to add supplier's name to our sale order (and potentially more fields from the purchase module), how can I do that?
I was trying to do it from the GUI, so I went to Settings-->Technical-->Database Structure-->Models (sale.order), added a field called x_Supplier, set it to Many2One, set Object Relation to res.partner.
Could some of you experienced users let me know what am I missing?
Thanks in advance!
To add a field to a Qweb view from the GUI, you should go to Settings/Technical/Reports/Reports and then :
Search for 'sale.order' report,
Click on the link "Search for Qweb Views",
Open the view named : report_saleorder_document,
In the view, choose th place you want to insert your new field (x_Supplier)
For example, to insert it after the Saleperson name, add this code after the div of Salepersonn
<div t-if="o.x_Supplier" class="col-xs-3">
Save the view.
Test by printing a Sale order .
Hope it helps
Thank you Laurent OLIVIER. I've tried that, but it did not work..
I wanted to add next to the product description in the table, so I did below:
When I tested it, the Supplier header showed up, but it's blank. I guess the o.x_Supplier didn't work?
<table class="table table-condensed">
<tr t-foreach="o.order_line" t-as="l">
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 11/29/16, 5:44 PM|
|Seen: 88 times|
|Last updated: 11/30/16, 11:25 PM|