[6.1,7.0,trunk] Context is not propagated when writing translation on 'source' fields

Bug #1247158 reported by Guewen Baconnier @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team
OpenERP Community Backports (Server)
Status tracked in 7.0
6.1
Fix Released
Undecided
Unassigned
7.0
Fix Released
Medium
OpenERP Community Backports

Bug Description

In openerp.osv.orm.BaseModel.write():

When we do a write on a record for a translation and a translation we are writing is empty in the 'source' translation, the ORM will write that value on the record (for en_US):
http://bazaar.launchpad.net/~openerp/openobject-server/7.0/view/head:/openerp/osv/orm.py#L4163

Precisely, the write is here: http://bazaar.launchpad.net/~openerp/openobject-server/7.0/view/head:/openerp/osv/orm.py#L4171

This call to write() isn't propagating the context, meaning that any special key in the context will be lost in the calls chain.

The context needs to be propagated, with the 'lang' key forced to the default language, that is: en_US.

I'll propose a merge.

Tags: maintenance

Related branches

Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello Guewen,

I would prefer the 'lang' key to be set at False instead of en_US. This would have the same result but using less openerp magic (en_US being the default language in openerp).
Is that ok with you ?

Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Low
Changed in openobject-server:
status: Confirmed → Fix Committed
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Re: [Bug 1247158] Re: [6.1, 7.0, trunk] Context is not propagated when writing translation on 'source' fields

Hello, that's alright for me. Thank!
Le 26 déc. 2013 11:35, "Martin Trigaux (OpenERP)" <email address hidden> a écrit
:

> Hello Guewen,
>
> I would prefer the 'lang' key to be set at False instead of en_US. This
> would have the same result but using less openerp magic (en_US being the
> default language in openerp).
> Is that ok with you ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1247158
>
> Title:
> [6.1,7.0,trunk] Context is not propagated when writing translation on
> 'source' fields
>
> Status in OpenERP Community Backports (Server):
> Fix Released
> Status in OpenERP Community Backports (Server) 7.0 series:
> Fix Released
> Status in OpenERP Server:
> Confirmed
>
> Bug description:
> In openerp.osv.orm.BaseModel.write():
>
> When we do a write on a record for a translation and a translation we
> are writing is empty in the 'source' translation, the ORM will write that
> value on the record (for en_US):
>
> http://bazaar.launchpad.net/~openerp/openobject-server/7.0/view/head:/openerp/osv/orm.py#L4163
>
> Precisely, the write is here: http://bazaar.launchpad.net/~openerp
> /openobject-server/7.0/view/head:/openerp/osv/orm.py#L4171
>
> This call to write() isn't propagating the context, meaning that any
> special key in the context will be lost in the calls chain.
>
> The context needs to be propagated, with the 'lang' key forced to the
> default language, that is: en_US.
>
> I'll propose a merge.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ocb-server/+bug/1247158/+subscriptions
>

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Thanks for the updated patch, merged into 7

revno: 5194 [merge]
revision-id: <email address hidden>

Changed in openobject-server:
status: Fix Committed → Fix Released
Changed in openobject-server:
milestone: none → 7.0
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.