[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
This commit is contained in:
Thibault Delavallée 2014-01-24 10:50:56 +01:00
parent c9260b90a8
commit ee692b43e2
8 changed files with 36 additions and 82 deletions

View File

@ -1,22 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.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/>.
#
##############################################################################
import account_product
import models

View File

@ -1,24 +1,4 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.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/>.
#
##############################################################################
{
'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,

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
import product
import invoice

View File

@ -1,30 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.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/>.
#
##############################################################################
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:

View File

@ -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'),
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_email_template_form_product" model="ir.ui.view">
<field name="name">email.template.form</field>
<field name="model">email.template</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<form string="Templates" version="7.0">
<h3>Body</h3>
<field name="body_html" placeholder="Rich-text/HTML content of the message (placeholders may be used here)"/>
<field name="attachment_ids" nolabel="1" widget="many2many_binary"/>
</form>
</field>
</record>
</data>
</openerp>

View File

@ -1,18 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_email_template_form_product" model="ir.ui.view">
<field name="name">email.template.form</field>
<field name="model">email.template</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<form string="Templates" version="7.0">
<h3>Body</h3>
<field name="body_html" placeholder="Rich-text/HTML content of the message (placeholders may be used here)"/>
<field name="attachment_ids" nolabel="1" widget="many2many_binary"/>
</form>
</field>
</record>
<record id="product_normal_form_view_template" model="ir.ui.view">
<field name="name">product.normal.procurement.locations.inherit</field>
<field name="model">product.product</field>
@ -23,6 +11,5 @@
</field>
</field>
</record>
</data>
</openerp>