Merge lp:~openerp-dev/openobject-server/trunk-opw-577295-port-rma into lp:openobject-server

Proposed by Randhir Mayatra (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-server/trunk-opw-577295-port-rma
Merge into: lp:openobject-server
Diff against target: 17 lines (+3/-2)
1 file modified
openerp/osv/orm.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/trunk-opw-577295-port-rma
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+138403@code.launchpad.net

Description of the change

Hello,

Fixed the issue of field when it refine in inherited object and save the record it was not allow to save when parent field is required.

e.g
when redefine required field in product_product that's already defined in product_template. As example
redefined standard_price in product_product.

Add this field on the form view, restart server and install or update module with this code
and create a new product, when save the record it generates the error.

Kindly review it.
Code is forward port from 6.1

Thnks
-RMA

To post a comment you must log in.
4644. By <Graeme Gellatly>

[FIX] Fixed the issue of field when it redefine in inherited object and save the record it was not allow to save when parent field is required.

Unmerged revisions

4644. By <Graeme Gellatly>

[FIX] Fixed the issue of field when it redefine in inherited object and save the record it was not allow to save when parent field is required.

4643. By <Graeme Gellatly>

[FIX] Fixed the issue of field when it redefine in inherited object and save the record it was not allow to save when parent field is required.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/osv/orm.py'
2--- openerp/osv/orm.py 2012-12-05 08:28:40 +0000
3+++ openerp/osv/orm.py 2012-12-06 10:07:28 +0000
4@@ -4295,10 +4295,11 @@
5 upd_todo = []
6 unknown_fields = []
7 for v in vals.keys():
8- if v in self._inherit_fields and v not in self._columns:
9+ if v in self._inherit_fields:
10 (table, col, col_detail, original_parent) = self._inherit_fields[v]
11 tocreate[table][v] = vals[v]
12- del vals[v]
13+ if v not in self._columns:
14+ del vals[v]
15 else:
16 if (v not in self._inherit_fields) and (v not in self._columns):
17 del vals[v]