Hi,

I want to check whether it is a bug or design as per initial.

For Product > Configuration > Product, when want to change the value. 

It call the below method "set_default_cost_price, with the delete 
"Property". However, the property is the system created record (xml below).
So whenever want to change the value, system will prevent it due to "System 
Created Record". In other words, it will forever unable to change this 
value.
Is it system design or miss on that?


    @classmethod
    def set_default_cost_price_method(cls, configurations, name, value):
        pool = Pool()
        Property = pool.get('ir.property')
        field = cls._get_product_field('cost_price_method')
        properties = Property.search([
                ('field', '=', field.id),
                ('res', '=', None),
                ])
        *Property.delete(properties)*
        if value:
            Property.create([{
                        'field': field.id,
                        'value': ',%s' % value,
                        }])

    <data noupdate="1">
        <record model="ir.property" id="property_cost_price_method">
            <field name="field"
                search="[('model.model', '=', 'product.template'), ('name', 
'=', 'cost_price_method')]"/>
            <field name="value">,fixed</field>
        </record>
    </data>

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/177d01f2-9814-49ba-a446-6336b76af337%40googlegroups.com.

Reply via email to