Add filters field to electronic.mail.template model

This commit is contained in:
jmartin 2015-07-09 11:30:13 +02:00
parent f52b0cf86f
commit 7611b785bc
5 changed files with 40 additions and 5 deletions

View file

@ -3,10 +3,12 @@
# copyright notices and license terms.
from trytond.pool import Pool
from .electronic_mail import *
from .template import *
def register():
Pool.register(
ElectronicMailFilter,
SearchingStart,
Template,
module='electronic_mail_filter', type_='model')

15
template.py Normal file
View file

@ -0,0 +1,15 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
__all__ = ['Template']
__metaclass__ = PoolMeta
class Template:
__name__ = 'electronic.mail.template'
filters = fields.One2Many('electronic.mail.filter', 'template',
'Filters')

16
template.xml Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part electronic_mail_template module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<!-- electronic.mail.template -->
<record model="ir.ui.view" id="template_view_form">
<field name="model">electronic.mail.template</field>
<field name="inherit"
ref="electronic_mail_template.template_view_form"/>
<field name="name">electronic_mail_template_form</field>
</record>
</data>
</tryton>

View file

@ -6,4 +6,5 @@ depends:
electronic_mail_template
searching
xml:
electronic_mail.xml
electronic_mail.xml
template.xml

View file

@ -3,9 +3,10 @@
The COPYRIGHT file at the top level of this repository contains the full
copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='language']"
position="after">
<label name="single_email"/>
<field name="single_email"/>
<xpath expr="/form/notebook/page[@id='advanced']" position="after">
<page string="Filters" id="filters">
<label name="filters"/>
<field name="filters"/>
</page>
</xpath>
</data>