Browse Source

Hardcode constraints in the `create` method instead of using normal ones.

Depending on the context where the record is created, it gets `resource` or `model_id`. The problem is that Odoo checks constrains before inverses, so constrains would fail always.

Test added to ensure future versions contemplate all use cases.
pull/870/head
Jairo Llopis 8 years ago
parent
commit
47033695ce
  1. 5
      base_export_manager/views/ir_exports_view.xml

5
base_export_manager/views/ir_exports_view.xml

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
@ -38,7 +40,8 @@
<field name="resource"/>
</group>
<group>
<field name="export_fields" nolabel="1">
<field name="export_fields" nolabel="1"
context="{'default_model1_id': model_id}">
<tree editable="bottom">
<field name="sequence" invisible="True"/>
<field name="model1_id" invisible="True"/>

Loading…
Cancel
Save