mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-23 17:02:00 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
|
|
@ -0,0 +1,20 @@
|
|||
export const addProductLineToOrder = async (
|
||||
store,
|
||||
order,
|
||||
{ templateId = 1, productId = 1, qty = 1, price_unit = 10, ...extraFields } = {}
|
||||
) => {
|
||||
const template = store.models["product.template"].get(templateId);
|
||||
const product = store.models["product.product"].get(productId);
|
||||
|
||||
const lineData = {
|
||||
product_tmpl_id: template,
|
||||
product_id: product,
|
||||
qty,
|
||||
price_unit,
|
||||
...extraFields,
|
||||
};
|
||||
|
||||
const line = await store.addLineToOrder(lineData, order);
|
||||
|
||||
return line;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue