Hello.
I would like to know how to add a custom field to the point of sale in Odoo 15, in its past versions you could add it very simply in the pos.xml, now it has become more complicated, so I would like to know if anyone knows how to do it in this version.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
Hi,
Please refer the following code to add custom field in POS.
in .js
odoo.define('module_name.custom_field', function(require) { "use strict"; var models = require('point_of_sale.models'); var product_barcode = models.load_fields("product.product", 'field_name'); });
in .xml
in the below xml we are adding the loaded field into product view
<templates id="template" xml:space="preserve"> <t t-name="ProductItem" t-inherit="point_of_sale.ProductItem" t-inherit-mode="extension" owl="1"> <xpath expr="//div[hasclass('product-img')]" position="after"> <t t-if="props.product.custom_field"> <span style="font-size: 10px;" class="price-tag" t-esc="props.product.custom_field"/> </t> </xpath> </t> </templates>
Regards
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
AanmeldenGerelateerde posts | Antwoorden | Weergaven | Activiteit | |
---|---|---|---|---|
|
2
mrt. 23
|
14817 | ||
|
1
mei 24
|
2507 | ||
|
2
okt. 22
|
3645 | ||
|
1
sep. 22
|
3821 | ||
|
1
aug. 22
|
2814 |