Merge lp:~camptocamp/openobject-server/7.0-no-sql-constraint-abstract-model-1151703 into lp:openobject-server/7.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-server/7.0-no-sql-constraint-abstract-model-1151703
Merge into: lp:openobject-server/7.0
Diff against target: 13 lines (+2/-1)
1 file modified
openerp/osv/orm.py (+2/-1)
To merge this branch: bzr merge lp:~camptocamp/openobject-server/7.0-no-sql-constraint-abstract-model-1151703
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp (community) code review, no test Approve
OpenERP Core Team Pending
Review via email: mp+152125@code.launchpad.net

Commit message

[FIX] add SQL constraints only for models stored in database (not on AbstractModel)

Description of the change

Fix for lp:1151703 (sql_constraints should not be created for AbstractModel)

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)

Unmerged revisions

4880. By Guewen Baconnier @ Camptocamp on 2013-03-07

[FIX] add SQL constraints only for models stored in database (not on AbstractModel)

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 2013-02-11 14:36:47 +0000
3+++ openerp/osv/orm.py 2013-03-07 09:01:32 +0000
4@@ -3207,7 +3207,8 @@
5
6 cr.commit() # start a new transaction
7
8- self._add_sql_constraints(cr)
9+ if getattr(self, '_auto', True):
10+ self._add_sql_constraints(cr)
11
12 if create:
13 self._execute_sql(cr)