Guewen Baconnier
10 years ago
committed by
Pierre Verkest
8 changed files with 322 additions and 0 deletions
-
23base_comment_template/README.rst
-
2base_comment_template/__init__.py
-
31base_comment_template/__openerp__.py
-
43base_comment_template/comment.py
-
51base_comment_template/comment_view.xml
-
85base_comment_template/i18n/base_comment_template.pot
-
85base_comment_template/i18n/fr.po
-
2base_comment_template/security/ir.model.access.csv
@ -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 <nicolas.bessi@camptocamp.com> |
|||
* Yannick Vaucher <yannick.vaucher@camptocamp.com> |
|||
* Guewen Baconnier <guewen.baconnier@camptocamp.com> |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from . import comment |
@ -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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
# |
|||
{"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, } |
@ -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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
# |
|||
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 |
@ -0,0 +1,51 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<openerp> |
|||
<data> |
|||
<record model="ir.ui.view" id="view_base_comment_template_search"> |
|||
<field name="name">base.comment.template.search</field> |
|||
<field name="model">base.comment.template</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Comment Templates"> |
|||
<field name="name"/> |
|||
<field name="position"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_base_comment_template_form"> |
|||
<field name="name">base.comment.template.form</field> |
|||
<field name="model">base.comment.template</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Comment Templates"> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="position"/> |
|||
<field name="text" colspan="4"/> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.ui.view" id="view_base_comment_template_tree"> |
|||
<field name="name">account.comment.template.list</field> |
|||
<field name="model">base.comment.template</field> |
|||
<field name="priority" eval="6"/> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Comment Templates"> |
|||
<field name="name"/> |
|||
<field name="position"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record model="ir.actions.act_window" id="action_base_comment_template"> |
|||
<field name="name">Comment Templates</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">base.comment.template</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_id" ref="view_base_comment_template_tree"/> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -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 "" |
|||
|
@ -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" |
@ -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 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue