I'm making a custom order form, how can I save the data in this form into the order sale and custom order table?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
1
Répondre
1796
Vues
You need to have access to sale model to be able to create a record
In your create method of your custom model you can call the below
self.env['sale.order'].create(vals)
vals: a dictionary for all sale.order and sale.order.line values, You need to pass all required fields and other fields you want.
For example:
vals= {
'partner_id': self.partner.id,
'order_line': [(0, 0, {
'product_id': self.product.id,
'product_uom_qty': 1,
'price_unit': 192,
'discount': 74.246,
})]
})
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire