Browse Source

[IMP] base_export_manager: Several things (II):

* Improve UX for base_export_manager.

  - Improve user instructions in README.
  - Require some required fields.
  - Allow to select models from a list.
  - Allow to select up to 3 fields from dynamic lists.
  - Improve translations.
  - More tests.
  - Translate column labels.

  Some methods have been renamed, so version tag is raised to 8.0.2.0.0.

* 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.

* Allow to reorder fields.
pull/67/head
Jairo Llopis 9 years ago
committed by Olivier Jossen
parent
commit
6a391016fc
  1. 50
      base_export_manager/i18n/base_exports_manager.pot
  2. 26
      base_export_manager/static/src/js/main.js
  3. 38
      base_export_manager/views/ir_exports_view.xml

50
base_export_manager/i18n/base_exports_manager.pot

@ -1,50 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_exports_manager
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-27 12:38+0000\n"
"PO-Revision-Date: 2015-10-27 12:38+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_exports_manager
#: view:ir.exports:base_exports_manager.ir_exports_form_view
msgid "Export Profile"
msgstr ""
#. module: base_exports_manager
#: model:ir.actions.act_window,name:base_exports_manager.ir_exports_action
#: view:ir.exports:base_exports_manager.ir_exports_tree_view
#: model:ir.ui.menu,name:base_exports_manager.ir_exports_menu
msgid "Export Profiles"
msgstr ""
#. module: base_exports_manager
#: code:addons/base_exports_manager/models/ir_exports_line.py:62
#, python-format
msgid "Field '%s' already exists"
msgstr ""
#. module: base_exports_manager
#: code:addons/base_exports_manager/models/ir_exports_line.py:57
#, python-format
msgid "Field '%s' does not exist"
msgstr ""
#. module: base_exports_manager
#: field:ir.exports.line,sequence:0
msgid "Sequence"
msgstr ""
#. module: base_exports_manager
#: field:ir.exports.line,label:0
msgid "Label"
msgstr ""

26
base_export_manager/static/src/js/main.js

@ -1,27 +1,5 @@
/**
* # -*- coding: utf-8 -*-
* ##############################################################################
* #
* # OpenERP, Open Source Management Solution
* # This module copyright :
* # (c) 2014 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com)
* # Antonio Espinosa <antonioea@antiun.com>
* #
* # This program is free software: you can redistribute it and/or modify
* # it under the terms of the GNU Affero General Public License as
* # published by the Free Software Foundation, either version 3 of the
* # License, or (at your option) any later version.
* #
* # This program is distributed in the hope that it will be useful,
* # but WITHOUT ANY WARRANTY; without even the implied warranty of
* # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* # GNU Affero General Public License for more details.
* #
* # You should have received a copy of the GNU Affero General Public License
* # along with this program. If not, see <http://www.gnu.org/licenses/>.
* #
* ##############################################################################
*/
/* © 2015 Antiun Ingeniería S.L. - Antonio Espinosa
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). */
// Check jQuery available
if (typeof jQuery === 'undefined') { throw new Error('Requires jQuery') }

38
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>
@ -20,6 +22,7 @@
<field name="arch" type="xml">
<tree string="Export Profiles">
<field name="name"/>
<field name="model_id"/>
<field name="resource"/>
</tree>
</field>
@ -32,14 +35,45 @@
<form string="Export Profile">
<group>
<field name="name"/>
<field name="model_id"
options="{'no_create': True}"/>
<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" widget="handle"/>
<field name="model1_id" invisible="True"/>
<field name="model2_id" invisible="True"/>
<field name="model3_id" invisible="True"/>
<field name="label"/>
<field name="name"/>
<field name="sequence" invisible="1"/>
<field
name="field1_id"
required="True"
options="{
'no_open': True,
'no_create': True,
}"/>
<field
name="field2_id"
attrs="{
'readonly': [('model2_id', '=', False)],
}"
options="{
'no_open': True,
'no_create': True,
}"/>
<field
name="field3_id"
attrs="{
'readonly': [('model3_id', '=', False)],
}"
options="{
'no_open': True,
'no_create': True,
}"/>
</tree>
</field>
</group>

Loading…
Cancel
Save