Hello, i am using odoo 16 enterprise online.
Currently every POS must one by one register all the pricelists in the POS Settings.
Is there a faster way to register all pricelist into POS ?
Server / automated actions ?
Import export ?
Thank You
Joie
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello, i am using odoo 16 enterprise online.
Currently every POS must one by one register all the pricelists in the POS Settings.
Is there a faster way to register all pricelist into POS ?
Server / automated actions ?
Import export ?
Thank You
Joie
Hi,
You can create a server action to execute the register_all_pricelists method on the pos.config model. To do this, go to Settings -> Technical -> Automation -> Server Actions and create a new action. In the "Action To Do" tab, set the "Model Name" to pos.config and the "Action Type" to Python Code. In the "Python Code" field, paste the code below.
def register_all_pricelists(self):
# Get all pricelists
pricelists = self.env['product.pricelist'].search([])
# Get POS configurations
pos_configs = self.env['pos.config'].search([])
# Register all pricelists in POS configurations
for pos_config in pos_configs:
pricelist_ids = [(4, pricelist.id) for pricelist in pricelists]
pos_config.write({'pricelist_ids': pricelist_ids})
return True
Regards
Thank you this is very useful, what if there is already existing pricelist in the pos ? For example : POS#1 has pricelist id 1 and 2. And POS#2 has pricelist 1. Altogether there is pricelist id 1,2,3,4,5.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Feb 23
|
922 | ||
|
0
Nov 21
|
779 | ||
|
3
Aug 20
|
2335 | ||
|
1
Nov 19
|
5126 | ||
|
1
Dec 24
|
134 |