Unable to change Product configuration for Cost Method

11 views
Skip to first unread message

Markus Bala

unread,
Oct 15, 2016, 4:09:53 AM10/15/16
to tryton-dev
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>

Cédric Krier

unread,
Oct 15, 2016, 4:30:03 AM10/15/16
to tryton-dev
On 2016-10-15 01:09, Markus Bala wrote:
> 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?

Please fill an issue.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Markus Bala

unread,
Oct 16, 2016, 3:04:36 AM10/16/16
to Tryton
On Sat, Oct 15, 2016 at 3:29 PM, Cédric Krier <cedric...@b2ck.com> wrote:
On 2016-10-15 01:09, Markus Bala wrote:
> 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?

Please fill an issue.

Hi Cedric,

I was register at Tryton list. It said need to wait for email confirmation.
However, I am still not received yet.

So unable to register the issue yet 

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

--
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/20161015082939.GY99626%40tetsuo.

Reply all
Reply to author
Forward
0 new messages