Tryton - Issues

 

Issue7557

Title Unable to assign domain to field with depends
Priority bug Status chatting
Superseder Nosy List iehoshia
Type behavior Components
Assigned To Keywords
Reviews

Created on 2018-07-03.03:42:22 by iehoshia, last changed by ced.

Messages
msg42054 (view) Author: [hidden] (iehoshia) Date: 2018-07-03.18:59:42
I have a custom menuitem and a custom action. The action has a pyson domain. 

When I don't use in the domain the field 'depreciable' the menu and action works fine and open the list correctly. 

When the field 'depreciable' and create a new record, the domain is not correct assigned to the fields. 

I can show the behavior when it has the domain with 'depreciable' [1] and without 'depreciable' [2] in the domain. 

[1] https://www.dropbox.com/s/zora8jzl8st49pb/with-depreciable.webm?dl=0

[2] https://www.dropbox.com/s/yqsoxkifkfim6f3/without-depreciable.webm?dl=0
msg42033 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-07-03.09:51:24
I do not understand "When the action is called the record mix the values of the fields and don't show it correctly." Please explain in details what is happening.
msg42031 (view) Author: [hidden] (iehoshia) Date: 2018-07-03.03:42:21
I created a custom act_window and a custom menuitem for product.template assuming that have account_asset activated. 

        <record model="ir.action.act_window" id="act_asset_form">
            <field name="name">Assets</field>
            <field name="res_model">product.template</field>
            <field name="domain" pyson="1"
                eval="[
                    ('company', '=', Eval('context', {}).get('company', -1)), 
                    ('type','=','assets'),
                    ('depreciable','=',True).
                    ]"/>
        </record>

        <menuitem parent="product.menu_main_product" action="act_asset_form"
            id="menu_template_assets" icon="tryton-list"/>

When the action is called the record mix the values of the fields and don't show it correctly. (return the type incorrectly). This is the field I tried to pass the value [1]. 

If I desactivate depreciable line, it works fine. 

[1] https://github.com/tryton/account_asset/blob/4.8/product.py#L103
History
Date User Action Args
2018-07-03 22:13:26cedsetstatus: need-eg -> chatting
nosy: - ced
2018-07-03 18:59:42iehoshiasetmessages: + msg42054
2018-07-03 09:51:24cedsetstatus: unread -> need-eg
nosy: + ced
messages: + msg42033
2018-07-03 03:42:22iehoshiacreate

Showing 10 items. Show all history (warning: this could be VERY long)