I am looking to manage prices by updating the attribute default additional price value.
I can understand that it may be unwise to have the default changing value change any additional set prices on individual products. Knowing the risks involved, Is there any way to force Odoo Online to use the default additional price only? Currently the default additional price will only apply after the price has been added and then the attribute is added to the product which is less than ideal. I have upwards of 10,000 variants I need to manage with the same attribute that will affect the price equally so changing the prices per product will be a hinderance to my users.
***updated with solution ***
After playing with chat gpt for a couple hours i have finally found my solution. If you want to update your pricing from the attribute menu rather than individually on each product and each attribute, which will take about 9 clicks per price extra value, you will need to create a server action that will do this update for you.
I activated the dev mode and under the technical section found the server action menu. Under this menu I created a server action called update attribute pricing that would execute code in the model 'product.template' . Then I used the following code to acheive this
# Fetch all attribute lines associated with the product
attribute_lines = env['product.template.attribute.value'].search([('product_tmpl_id', '=', record.id)])
for attribute_line in attribute_lines:
# Fetch the related product attribute value
attribute_value = attribute_line.product_attribute_value_id
if attribute_value:
# Fetch the default extra price from the product attribute value model
default_extra_price = attribute_value.default_extra_price
# Compare and update if necessary
if attribute_line.price_extra != default_extra_price:
attribute_line.write({'price_extra': default_extra_price})
now with this action created and activating a contextual action I can select products I wish to update pricing on and when using the action it will fetch the default_price_extra and apply those values to the price_extra fields on each product.