stock location - complete name is not updated on change of parent location name

Bug #600624 reported by Ferdinand
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Low
OpenERP R&D Addons Team 2

Bug Description

complete_name is only updated on change of child record.

Revision history for this message
JMA(Open ERP) (jma-openerp) wrote :

Hello Ferdinand,

Would you please provide a detailed explanation regarding the problem which you are facing?

Thank you.

Revision history for this message
Ferdinand (office-chricar) wrote :

in stock.py

'complete_name': fields.function(_complete_name, method=True, type='char', size=256, string="Location Name", store=True),

is called only on change of the child

so if the parent name is changed this is not reflected in complete_name and all reports are wrong.

BTW - I just wonder - the complete name is not translated ?? - so if the stock location name is translated it will not give a human readable sort.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Using store=True is a bad idea (our experience is that it doesn't get updated on lots of situations), store={...} (explicitly defining the objects/fields to watch for changes) should always be used instead.

Instead of :
'complete_name': fields.function(_complete_name, method=True, type='char', size=256, string="Location Name", store=True),

We should use something like this:
'complete_name': fields.function(_complete_name, method=True, type='char', size=256, string="Location Name",
            store={
                'stock.location': (_get_stock_location_and_children_ids, ['name'], 20),
            }),

Where _get_stock_location_and_children_ids should be a method that should return the given location ids plus the (recursive) children of those locations.

Revision history for this message
Ferdinand (office-chricar) wrote :

@Borja
Does this cover the translation issue ?

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

@Ferdinand

When you change the translated name, at least the GTK client does a normal write of the stock.location 'name' field*, so I suppose the store rules/triggers for 'stock.location' would be checked.

* Example of debug output:
DEBUG_RPC:rpc.request:('execute', 'test', 1, 'admin', ('stock.location', 'write', [1], {'name': 'Ubicaciones f\xc3\xadsicas'}, {'lang': u'es_ES', 'full': '1', 'tz': False, 'active_model': 'ir.ui.menu', 'section_id': False, 'active_id': 279, 'active_ids': [279], 'project_id': False, 'department_id': False}))

Changed in openobject-addons:
status: New → Incomplete
status: Incomplete → Triaged
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

We Let the addons2 team decide.

Thanks.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
Revision history for this message
Ferdinand (office-chricar) wrote :

it seems that this is not a db field any more in v6

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

As said by Dr. Ferdinand its not store=True in trunk-addons since very previous revision,
@bug qualification team: please check the validity of bugs with latest trunk before assigning,
Thanks,

Changed in openobject-addons:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.