Merge lp:~openerp-dev/openobject-server/6.0-bug-733252-xrg into lp:openobject-server/6.0
Status: | Rejected |
---|---|
Rejected by: | Olivier Dony (Odoo) |
Proposed branch: | lp:~openerp-dev/openobject-server/6.0-bug-733252-xrg |
Merge into: | lp:openobject-server/6.0 |
Diff against target: |
21 lines (+2/-2) 1 file modified
bin/osv/fields.py (+2/-2) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/6.0-bug-733252-xrg |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Dony (Odoo) | Needs Resubmitting | ||
OpenERP buildbot (community) | Approve | ||
Review via email: mp+53015@code.launchpad.net |
Unmerged revisions
- 3363. By xrg
-
osv/fields: required fields shall have ondelete="restrict" by default
Required fields have the set NOT NULL attribute. This cannot work together
with ON DELETE SET NULL behaviour for their referenced records. The
safest default seems to be ON DELETE RESTRICT.
Example: account.invoice: partner_ id, which has to restrict deleting a
partner when there is any invoices linked to him/her.
This merely improves the SQL messages, from:
IntegrityError: null value in column "partner_id" violates not-null constraint
CONTEXT: SQL statement "UPDATE ONLY "public"."account_ invoice" SET "partner_id" = NULL
WHERE $1 OPERATOR(pg_catalog. =) "partner_id""
to:
IntegrityError: update or delete on table "res_partner" violates foreign key
constraint "account_invoice_ partner_ id_fkey" on table "account_invoice"
DETAIL: Key (id)=(7) is still referenced from table "account_invoice".
I would have approved, but this is a wishlist, hence it should go against trunk :-)