I’m developing a custom POS module in Odoo 18 and could use some guidance. Each customer can have multiple codes, which are stored in a tab on the customer page. I want to create a dropdown in the POS that displays only the codes for the selected customer and allows me to save the selected code for the POS order. How is it possible?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
Hello Odoouser! Here’s how you can dynamically populate a dropdown in your POS module based on the selected customer:
First, define a new model to store customer-specific codes. This model should have a Many2one field linking it to the customer.
Next, in your POS module, create a Many2one field that links to the customer codes model. This will be your dropdown field.
Override the _prepare_pos_data
method in your POS model to fetch the codes related to the selected customer. Pass this data to the POS interface.
In the POS interface (JavaScript), listen for changes in the selected customer. When a customer is selected, update the dropdown options with the codes received from the server.
Finally, ensure that the selected code is saved with the POS order by properly handling the data transfer between the POS interface and the Odoo backend.
For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html
Hi,
Please take a look at the following for adding fields into the pos.
* https://www.cybrosys.com/blog/how-to-load-models-and-fields-to-pos-in-odoo-18
* https://www.cybrosys.com/odoo/videos/technical/how-to-load-custom-field-to-pos-in-odoo-17
Hope it helps
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
2
ก.ย. 25
|
371 | ||
|
0
ส.ค. 25
|
824 | ||
|
1
เม.ย. 25
|
1122 | ||
|
1
เม.ย. 25
|
1548 | ||
|
1
มิ.ย. 25
|
2459 |
Hello Odoouser! Here’s how you can dynamically populate a dropdown in your POS module based on the selected customer in Odoo 18:
First, define a new model to store the customer-specific codes. This model should have a many2one relationship with the
res.partner
model (customer) and a field to store the code.Next, in your POS module, create a new field in the
pos.order
model to store the selected code. This field should be a many2one relationship with your custom code model.Override the
_prepare_pos_order_line_vals
method in your POS module to include the selected code when creating the order line. This ensures the code is saved with the order.Create a new QWeb template to add the dropdown to the POS interface. Use JavaScript to dynamically update the dropdown options based on the selected customer. You can use an RPC call to fetch the codes for the selected customer from the server.
Finally, ensure that the JavaScript code is correctly linked to the QWeb template and that the RPC call is correctly configured to fetch the data from your custom model.
For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html
Thank you. I’m familiar with the general steps, but I would appreciate more detailed guidance.