Skip to Content
Menu
This question has been flagged

We are going to send product categories from our store to Odoo, so I need to set the costing method automatically to 'Average Price'. The default is 'Standard Price'. The odoo purchase settings only allow to change it manually for each product category.

Is there any option to apply for all products (or all product categories)? Or should I overwrite the product.category create method ? Any idea?

Thanks    

Avatar
Discard
Best Answer

Hi Edi,

By default there is no option to change all the costing of to Average other than changing it manually. Anyway you can do it by running python code to change it. You can run python code on button click or something else,

def set_cost(self):
product_categ = self.env['product.category'].search([])
for rec in product_categ:
rec.property_cost_method = 'average'


This is how you can update the existing one by python code. Also you can do by running update query in pgadmin.

For the newly creating one, you can set the defaults to average by, activate the developer mode, then select the average method in the costing method field, click on lady debugger button(button near logged in user name), click set defaults,

select costing method, then save.

Thanks

Avatar
Discard
Best Answer
  • Change the method on ONE Category.

  • Export all Categories into an Excel file.

  • Update all Categories to use the method set on the first.

  • Import all Categories.

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 24
2487
3
Oct 24
1168
0
Dec 17
1818
3
Jul 20
8120
1
Jan 19
4157