How can I create a section i sale order line using code(programatically) in odoo. Please provide your valuable answers
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
A section is actually a dummy sale order line with a display type section.
so you need to create new sale order line with `display_type` line_section and adjust the position with sequence value
ref: https://github.com/odoo/odoo/blob/12.0/addons/sale/models/sale.py#L1219
How could I can create it in onchange?
How can the duumy sale order line be show in the list view after entered? Right now it is only seen in reports or the preview online function?
Hi,
You can create section programatically by using the following code
class SaleOrder(models.Model):
_inherit = 'sale.order'
def custom_function(self):
order_lines = []
val = (0, 0, {
'display_type': 'line_section',
'name': 'SECTION NAME',
})
order_lines.append(val)
self.update({'order_line': order_lines})
How can the duumy sale order line be show in the list view after entered? Right now it is only seen in reports or the preview online function?
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
RekisteröidyAiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
---|---|---|---|---|
How to generate line numbers on quotes
Ratkaistu
|
|
1
tammik. 25
|
3284 | |
|
2
elok. 24
|
5787 | ||
|
6
jouluk. 22
|
8708 | ||
|
1
helmik. 22
|
2832 | ||
|
0
syysk. 20
|
3563 |
See these tips: https://goo.gl/8HgnCF