From ee692b43e2e24fd394ef13b36d4b8dfc437e0a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 24 Jan 2014 10:50:56 +0100 Subject: [PATCH] [REF] account_product_template: reorganized the module, according to the new module guildelines : - model files in model directory, with product and template addition - view files in views directory, with product and template view addition - demo file in data directory bzr revid: tde@openerp.com-20140124095056-v18lfk9wex5y00d7 --- addons/account_product_template/__init__.py | 21 +------------- .../account_product_template/__openerp__.py | 25 ++-------------- .../product_demo.xml} | 0 .../models/__init__.py | 4 +++ .../{account_product.py => models/invoice.py} | 29 ++----------------- .../models/product.py | 9 ++++++ .../views/email_template_view.xml | 17 +++++++++++ .../product_view.xml} | 13 --------- 8 files changed, 36 insertions(+), 82 deletions(-) rename addons/account_product_template/{account_product_template_demo.xml => data/product_demo.xml} (100%) create mode 100644 addons/account_product_template/models/__init__.py rename addons/account_product_template/{account_product.py => models/invoice.py} (55%) create mode 100644 addons/account_product_template/models/product.py create mode 100644 addons/account_product_template/views/email_template_view.xml rename addons/account_product_template/{account_product_view.xml => views/product_view.xml} (55%) diff --git a/addons/account_product_template/__init__.py b/addons/account_product_template/__init__.py index f1d4402985a..c7b5ac7e1f2 100644 --- a/addons/account_product_template/__init__.py +++ b/addons/account_product_template/__init__.py @@ -1,22 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2014-Today OpenERP SA (). -# -# 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 . -# -############################################################################## -import account_product +import models diff --git a/addons/account_product_template/__openerp__.py b/addons/account_product_template/__openerp__.py index 52ce602db3e..2fdce7f2889 100644 --- a/addons/account_product_template/__openerp__.py +++ b/addons/account_product_template/__openerp__.py @@ -1,24 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2014-Today OpenERP SA (). -# -# 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 Email Template', @@ -34,10 +14,11 @@ For instance when invoicing a training, the training agenda and materials will a """, 'website': 'http://www.openerp.com', 'demo': [ - 'account_product_template_demo.xml', + 'data/product_demo.xml', ], 'data': [ - 'account_product_view.xml', + 'views/product_view.xml', + 'views/email_template_view.xml', ], 'installable': True, 'auto_install': False, diff --git a/addons/account_product_template/account_product_template_demo.xml b/addons/account_product_template/data/product_demo.xml similarity index 100% rename from addons/account_product_template/account_product_template_demo.xml rename to addons/account_product_template/data/product_demo.xml diff --git a/addons/account_product_template/models/__init__.py b/addons/account_product_template/models/__init__.py new file mode 100644 index 00000000000..2edb825574d --- /dev/null +++ b/addons/account_product_template/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +import product +import invoice diff --git a/addons/account_product_template/account_product.py b/addons/account_product_template/models/invoice.py similarity index 55% rename from addons/account_product_template/account_product.py rename to addons/account_product_template/models/invoice.py index 0dd19422581..c5817e00040 100644 --- a/addons/account_product_template/account_product.py +++ b/addons/account_product_template/models/invoice.py @@ -1,30 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2014-Today OpenERP SA (). -# -# 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.osv import fields, osv -class product_template(osv.osv): - _inherit = "product.template" - _columns = { - 'email_template_id': fields.many2one('email.template','Product Email Template'), - } +from openerp.osv import osv + class account_invoice(osv.Model): _inherit = 'account.invoice' @@ -53,5 +30,3 @@ class account_invoice(osv.Model): }, context=context) mail_msg_obj.send_mail(cr, uid, [message_wiz_id], context=context) return res - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_product_template/models/product.py b/addons/account_product_template/models/product.py new file mode 100644 index 00000000000..e7799115a69 --- /dev/null +++ b/addons/account_product_template/models/product.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +from openerp.osv import fields, osv + +class product_template(osv.osv): + _inherit = "product.template" + _columns = { + 'email_template_id': fields.many2one('email.template','Product Email Template'), + } diff --git a/addons/account_product_template/views/email_template_view.xml b/addons/account_product_template/views/email_template_view.xml new file mode 100644 index 00000000000..aef44b0c414 --- /dev/null +++ b/addons/account_product_template/views/email_template_view.xml @@ -0,0 +1,17 @@ + + + + + email.template.form + email.template + 100 + +
+

Body

+ + + + +
+
+
diff --git a/addons/account_product_template/account_product_view.xml b/addons/account_product_template/views/product_view.xml similarity index 55% rename from addons/account_product_template/account_product_view.xml rename to addons/account_product_template/views/product_view.xml index 848c67d4a5a..f243bae8bf5 100644 --- a/addons/account_product_template/account_product_view.xml +++ b/addons/account_product_template/views/product_view.xml @@ -1,18 +1,6 @@ - - email.template.form - email.template - 100 - -
-

Body

- - - - -
product.normal.procurement.locations.inherit product.product @@ -23,6 +11,5 @@ -