diff --git a/base_comment_template/README.rst b/base_comment_template/README.rst new file mode 100644 index 00000000..2383ed1a --- /dev/null +++ b/base_comment_template/README.rst @@ -0,0 +1,23 @@ +Base Comments Templates +======================= + +Add a new model to define templates of comments to print on +documents. + +Two positions are available for the comments: + +- above document lines +- below document lines + +This module is the base module for following modules: + +* sale_comment_template +* purchase_comment_template +* invoice_comment_template + +Contributors +------------ + +* Nicolas Bessi +* Yannick Vaucher +* Guewen Baconnier diff --git a/base_comment_template/__init__.py b/base_comment_template/__init__.py new file mode 100644 index 00000000..72bf49f6 --- /dev/null +++ b/base_comment_template/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import comment diff --git a/base_comment_template/__openerp__.py b/base_comment_template/__openerp__.py new file mode 100644 index 00000000..ba603c62 --- /dev/null +++ b/base_comment_template/__openerp__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# +# +# Author: Nicolas Bessi +# Copyright 2013-2014 Camptocamp 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": "Base Comments Templates", + "summary": "Comments templates on documents", + "version": "8.0.1.0.0", + "depends": ["base"], + "author": "Camptocamp,Odoo Community Association (OCA)", + "data": ["comment_view.xml", + 'security/ir.model.access.csv', + ], + "category": "Sale", + "installable": True, + "active": False, } diff --git a/base_comment_template/comment.py b/base_comment_template/comment.py new file mode 100644 index 00000000..eee893b9 --- /dev/null +++ b/base_comment_template/comment.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# +# +# Author: Nicolas Bessi +# Copyright 2013-2014 Camptocamp 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 import models, fields, api + + +class BaseCommentTemplate(models.Model): + _name = "base.comment.template" + _description = "Base comment template" + + name = fields.Char('Comment summary', required=True) + position = fields.Selection([('before_lines', 'Before lines'), + ('after_lines', 'After lines')], + 'Position', + required=True, + default='before_lines', + help="Position on document") + text = fields.Html('Comment', translate=True, required=True) + + @api.multi + def get_value(self, partner_id=False): + self.ensure_one() + lang = None + if partner_id: + lang = self.env['res.partner'].browse(partner_id).lang + return self.with_context({'lang': lang}).text diff --git a/base_comment_template/comment_view.xml b/base_comment_template/comment_view.xml new file mode 100644 index 00000000..5a6cbd6c --- /dev/null +++ b/base_comment_template/comment_view.xml @@ -0,0 +1,51 @@ + + + + + base.comment.template.search + base.comment.template + + + + + + + + + + base.comment.template.form + base.comment.template + +
+ + + + + +
+
+
+ + + account.comment.template.list + base.comment.template + + + + + + + + + + + Comment Templates + ir.actions.act_window + base.comment.template + form + tree,form + + + +
+
diff --git a/base_comment_template/i18n/base_comment_template.pot b/base_comment_template/i18n/base_comment_template.pot new file mode 100644 index 00000000..242e5bdc --- /dev/null +++ b/base_comment_template/i18n/base_comment_template.pot @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-22 07:20+0000\n" +"PO-Revision-Date: 2014-10-22 07:20+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_comment_template +#: selection:base.comment.template,position:0 +msgid "After lines" +msgstr "" + +#. module: base_comment_template +#: model:ir.model,name:base_comment_template.model_base_comment_template +msgid "Base comment template" +msgstr "" + +#. module: base_comment_template +#: selection:base.comment.template,position:0 +msgid "Before lines" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,text:0 +msgid "Comment" +msgstr "" + +#. module: base_comment_template +#: view:base.comment.template:base_comment_template.view_base_comment_template_form +#: view:base.comment.template:base_comment_template.view_base_comment_template_search +#: view:base.comment.template:base_comment_template.view_base_comment_template_tree +#: model:ir.actions.act_window,name:base_comment_template.action_base_comment_template +msgid "Comment Templates" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,name:0 +msgid "Comment summary" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,create_date:0 +msgid "Created on" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,id:0 +msgid "ID" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,position:0 +msgid "Position" +msgstr "" + +#. module: base_comment_template +#: help:base.comment.template,position:0 +msgid "Position on document" +msgstr "" + diff --git a/base_comment_template/i18n/fr.po b/base_comment_template/i18n/fr.po new file mode 100644 index 00000000..c05cfa4f --- /dev/null +++ b/base_comment_template/i18n/fr.po @@ -0,0 +1,85 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_comment_template +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-22 07:20+0000\n" +"PO-Revision-Date: 2014-10-22 07:20+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_comment_template +#: selection:base.comment.template,position:0 +msgid "After lines" +msgstr "Après les lignes" + +#. module: base_comment_template +#: model:ir.model,name:base_comment_template.model_base_comment_template +msgid "Base comment template" +msgstr "Modèle de textes de commentaires" + +#. module: base_comment_template +#: selection:base.comment.template,position:0 +msgid "Before lines" +msgstr "Avant les lignes" + +#. module: base_comment_template +#: field:base.comment.template,text:0 +msgid "Comment" +msgstr "Commentaire" + +#. module: base_comment_template +#: view:base.comment.template:base_comment_template.view_base_comment_template_form +#: view:base.comment.template:base_comment_template.view_base_comment_template_search +#: view:base.comment.template:base_comment_template.view_base_comment_template_tree +#: model:ir.actions.act_window,name:base_comment_template.action_base_comment_template +msgid "Comment Templates" +msgstr "Modèles de commentaires" + +#. module: base_comment_template +#: field:base.comment.template,name:0 +msgid "Comment summary" +msgstr "Nom" + +#. module: base_comment_template +#: field:base.comment.template,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,create_date:0 +msgid "Created on" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,id:0 +msgid "ID" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: base_comment_template +#: field:base.comment.template,position:0 +msgid "Position" +msgstr "Position" + +#. module: base_comment_template +#: help:base.comment.template,position:0 +msgid "Position on document" +msgstr "Position sur le document" diff --git a/base_comment_template/security/ir.model.access.csv b/base_comment_template/security/ir.model.access.csv new file mode 100644 index 00000000..7485600f --- /dev/null +++ b/base_comment_template/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_base_comment_template,access_base_comment_template no one,model_base_comment_template,base.group_no_one,1,1,1,1