Hello,i am trying to add a barcode of a products in the order lines,want to put it near price, does someone know how can i achieve this?
Thank you.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hi
Try code,
1. Load product barcode in POS.
@api.model
def _load_pos_data_fields(self, config_id):
params = super()._load_pos_data_fields(config_id)
params += ['custom_discount_reason']
return params
2. Add the below js file:
patch(PosOrderline.prototype, {
setup(vals) {
var self = this;
super.setup(...arguments);
},
get_barcode() {
return this.barcode || '';
},
getDisplayData() {
return {
...super.getDisplayData(),
get_custom_discount_reason: this.get_custom_discount_reason(),
discount: this.discount,
};
},
});
patch(Orderline, {
props: {
...Orderline.props,
line: {
...Orderline.props.line,
shape: {
...Orderline.props.line.shape,
get_custom_discount_reason: { type: String, optional: true }
},
},
},
});
3. Inherit pos orderline for adding the barcode inside orderline.
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="Orderline" t-inherit="point_of_sale.Orderline" t-inherit-mode="extension">
<xpath expr="//ul[hasclass('info-list')]" position="inside">
<li t-if="line.get_barcode" id='barcode' class="text-info fw-bolder">
<t t-esc="line.get_barcode" />
</li>
</xpath>
</t>
</templates>
Hope it helps
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
เม.ย. 25
|
736 | ||
add a “today” filter on a view
แก้ไขแล้ว
|
|
1
มี.ค. 25
|
2560 | |
|
2
มี.ค. 25
|
670 | ||
|
2
มี.ค. 25
|
1182 | ||
|
7
ก.พ. 25
|
1875 |