From db89d0173989ce177ad103278aad2d7a8ef4ca6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=A9al?= Date: Sun, 24 May 2015 14:34:29 +0200 Subject: [PATCH] [ADD] product_export_field_profile module --- product_export_field_profile/README.rst | 12 +++ product_export_field_profile/__init__.py | 1 + product_export_field_profile/__openerp__.py | 52 +++++++++++ product_export_field_profile/export.py | 27 ++++++ .../ir.exports.line.csv | 15 +++ .../ir_exports_line_data.xml | 92 +++++++++++++++++++ product_export_field_profile/misc_data.xml | 16 ++++ 7 files changed, 215 insertions(+) create mode 100644 product_export_field_profile/README.rst create mode 100644 product_export_field_profile/__init__.py create mode 100644 product_export_field_profile/__openerp__.py create mode 100644 product_export_field_profile/export.py create mode 100644 product_export_field_profile/ir.exports.line.csv create mode 100644 product_export_field_profile/ir_exports_line_data.xml create mode 100644 product_export_field_profile/misc_data.xml diff --git a/product_export_field_profile/README.rst b/product_export_field_profile/README.rst new file mode 100644 index 0000000..110f0f7 --- /dev/null +++ b/product_export_field_profile/README.rst @@ -0,0 +1,12 @@ + Product Export Field Profile + ============================ + + Add export list (native export screen) to: + + * product + * partner + + Note to mainteners + ------------------ + You can maintain csv data file and convert in xml + with https://github.com/akretion/csv2xml4odoo diff --git a/product_export_field_profile/__init__.py b/product_export_field_profile/__init__.py new file mode 100644 index 0000000..4435ea7 --- /dev/null +++ b/product_export_field_profile/__init__.py @@ -0,0 +1 @@ +from . import export diff --git a/product_export_field_profile/__openerp__.py b/product_export_field_profile/__openerp__.py new file mode 100644 index 0000000..60db510 --- /dev/null +++ b/product_export_field_profile/__openerp__.py @@ -0,0 +1,52 @@ +# coding: utf-8 +############################################################################## +# +# Copyright 2015 Akretion +# +# 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 . +# +############################################################################## + +{ + 'name': 'Product Export Field Profile', + 'version': '1.0', + 'author': 'Akretion', + 'summarize': 'Add predefined list for export', + 'maintainer': 'Akretion', + 'description': """ + Product Export Field Profile + ============================ + + Add export list (native export screen) to: + + * product + * partner + + Note to mainteners + ------------------ + You can maintain csv data file and convert in xml + with https://github.com/akretion/csv2xml4odoo + """, + 'category': 'product', + 'depends': [ + 'product_profile', + ], + 'website': 'http://www.akretion.com/', + 'data': [ + 'misc_data.xml', + 'ir_exports_line_data.xml', + ], + 'installable': True, + 'license': 'AGPL-3', +} diff --git a/product_export_field_profile/export.py b/product_export_field_profile/export.py new file mode 100644 index 0000000..a79d83e --- /dev/null +++ b/product_export_field_profile/export.py @@ -0,0 +1,27 @@ +# coding: utf-8 +############################################################################## +# +# Copyright 2015 Akretion +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class IrExportsLine(models.Model): + _inherit = 'ir.exports.line' + + sequence = fields.Integer() diff --git a/product_export_field_profile/ir.exports.line.csv b/product_export_field_profile/ir.exports.line.csv new file mode 100644 index 0000000..efedeab --- /dev/null +++ b/product_export_field_profile/ir.exports.line.csv @@ -0,0 +1,15 @@ +"id","export_id/id","sequence","name" +"partner0","ir_exp_partner",0,"name" +"partner1","ir_exp_partner",4,"parent_id" +"partner2","ir_exp_partner",8,"city" +"partner3","ir_exp_partner",12,"zip" +"partner4","ir_exp_partner",16,"street" +"partner5","ir_exp_partner",20,"phone" +"partner6","ir_exp_partner",24,"mobile" +"partner7","ir_exp_partner",28,"is_company" +"partner8","ir_exp_partner",32,"function" +"product0","ir_exp_product",0,"profile_id" +"product1","ir_exp_product",4,"categ_id" +"product2","ir_exp_product",8,"name" +"product3","ir_exp_product",12,"attribute_line_ids/attribute_id/id" +"product4","ir_exp_product",16,"attribute_line_ids/value_ids/id" diff --git a/product_export_field_profile/ir_exports_line_data.xml b/product_export_field_profile/ir_exports_line_data.xml new file mode 100644 index 0000000..962cfd0 --- /dev/null +++ b/product_export_field_profile/ir_exports_line_data.xml @@ -0,0 +1,92 @@ + + + + + + + + + name + + + + + + parent_id + + + + + + city + + + + + + zip + + + + + + street + + + + + + phone + + + + + + mobile + + + + + + is_company + + + + + + function + + + + + + profile_id + + + + + + categ_id + + + + + + name + + + + + + attribute_line_ids/attribute_id/id + + + + + + attribute_line_ids/value_ids/id + + + + + diff --git a/product_export_field_profile/misc_data.xml b/product_export_field_profile/misc_data.xml new file mode 100644 index 0000000..6b303de --- /dev/null +++ b/product_export_field_profile/misc_data.xml @@ -0,0 +1,16 @@ + + + + + + Partner + res.partner + + + + Product + product.template + + + +