[MERGE]merge with parent branch
bzr revid: fka@tinyerp.com-20120905093458-cqq0hvmo6cx8idkb
This commit is contained in:
@@ -1361,10 +1361,16 @@ class account_invoice_line(osv.osv):
|
||||
'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
|
||||
'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
|
||||
}
|
||||
|
||||
def _default_account_id(self, cr, uid, ids, context=None):
|
||||
prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context)
|
||||
return prop and prop.id or False
|
||||
|
||||
_defaults = {
|
||||
'quantity': 1,
|
||||
'discount': 0.0,
|
||||
'price_unit': _price_unit_default,
|
||||
'account_id': _default_account_id,
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
@@ -1473,10 +1479,11 @@ class account_invoice_line(osv.osv):
|
||||
prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
|
||||
prod_uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
|
||||
if prod.uom_id.category_id.id != prod_uom.category_id.id:
|
||||
warning = {
|
||||
warning = {
|
||||
'title': _('Warning!'),
|
||||
'message': _('The selected unit of measure is not compatible with the unit of measure of the product.')
|
||||
}
|
||||
}
|
||||
res['value'].update({'uos_id': prod.uom_id.id})
|
||||
return {'value': res['value'], 'warning': warning}
|
||||
return res
|
||||
|
||||
|
||||
@@ -191,17 +191,23 @@
|
||||
<page string="Invoice">
|
||||
<field context="{'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line">
|
||||
<tree string="Invoice lines" editable="bottom">
|
||||
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" groups="base.group_account_user"/>
|
||||
<field name="invoice_line_tax_id" view_mode="2" context="{'type':parent.type}" domain="[('parent_id','=',False)]"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="product_id"
|
||||
on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
<field name="account_id" groups="account.group_account_user"
|
||||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
|
||||
domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" invisible="1"/>
|
||||
<!-- Removed if subtotal is set -->
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="uos_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
@@ -342,17 +348,22 @@
|
||||
<page string="Invoice Lines">
|
||||
<field name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}">
|
||||
<tree string="Invoice Lines" editable="bottom">
|
||||
<field name="invoice_line_tax_id" invisible="1"/>
|
||||
<field name="product_id" />
|
||||
<field name="product_id"
|
||||
on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
<field name="account_id" groups="account.group_account_user"
|
||||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]"
|
||||
domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '!=', 'view')]"
|
||||
on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"
|
||||
domain="[('type','!=','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]"/>
|
||||
<field name="quantity"/>
|
||||
<field name="uos_id" groups="product.group_uom"
|
||||
on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="discount" groups="sale.group_discount_per_so_line"/>
|
||||
<field name="invoice_line_tax_id" widget="many2many_tags" context="{'type':parent.type}"
|
||||
domain="[('parent_id','=',False),('company_id', '=', parent.company_id)]"/>
|
||||
<field name="price_subtotal"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -123,64 +123,6 @@
|
||||
</div>
|
||||
</div>
|
||||
]]></field>
|
||||
<field name="body"><![CDATA[
|
||||
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
|
||||
|
||||
A new invoice is available for ${object.partner_id.name}:
|
||||
| Invoice number: *${object.number}*
|
||||
| Invoice total: *${object.amount_total} ${object.currency_id.name}*
|
||||
| Invoice date: ${object.date_invoice}
|
||||
% if object.origin:
|
||||
| Order reference: ${object.origin}
|
||||
% endif
|
||||
| Your contact: ${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
|
||||
|
||||
You can view the invoice document, download it and pay online using the following link:
|
||||
${ctx.get('edi_web_url_view') or 'n/a'}
|
||||
|
||||
% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'):
|
||||
<%
|
||||
comp_name = quote(object.company_id.name)
|
||||
inv_number = quote(object.number)
|
||||
paypal_account = quote(object.company_id.paypal_account)
|
||||
inv_amount = quote(str(object.amount_total))
|
||||
cur_name = quote(object.currency_id.name)
|
||||
paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Invoice%%20%s"\
|
||||
"&invoice=%s&amount=%s¤cy_code=%s&button_subtype=services&no_note=1&bn=OpenERP_Invoice_PayNow_%s" % \
|
||||
(paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name)
|
||||
%>
|
||||
It is also possible to directly pay with Paypal:
|
||||
${paypal_url}
|
||||
% endif
|
||||
|
||||
If you have any question, do not hesitate to contact us.
|
||||
|
||||
|
||||
Thank you for choosing ${object.company_id.name}!
|
||||
|
||||
|
||||
--
|
||||
${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
|
||||
${object.company_id.name}
|
||||
% if object.company_id.street:
|
||||
${object.company_id.street or ''}
|
||||
% endif
|
||||
% if object.company_id.street2:
|
||||
${object.company_id.street2}
|
||||
% endif
|
||||
% if object.company_id.city or object.company_id.zip:
|
||||
${object.company_id.zip or ''} ${object.company_id.city or ''}
|
||||
% endif
|
||||
% if object.company_id.country_id:
|
||||
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
|
||||
% endif
|
||||
% if object.company_id.phone:
|
||||
Phone: ${object.company_id.phone}
|
||||
% endif
|
||||
% if object.company_id.website:
|
||||
${object.company_id.website or ''}
|
||||
% endif
|
||||
]]></field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -186,19 +186,23 @@
|
||||
<search string="Search Analytic Lines">
|
||||
<field name="name" string="Analytic Line"/>
|
||||
<field name="date"/>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" icon="terp-camera_test" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" icon="terp-purchase" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]" icon="terp-folder-orange"/>
|
||||
<filter name="sales" string="Sales" domain="[('journal_id.type','=','sale')]" help="Analytic Journal Items related to a sale journal."/>
|
||||
<filter name="purchases" string="Purchases" domain="[('journal_id.type','=','purchase')]" help="Analytic Journal Items related to a purchase journal."/>
|
||||
<filter name="others" string="Others" domain="[('journal_id.type','in',('cash','general','situation'))]"/>
|
||||
<separator/>
|
||||
<filter string="My Entries" domain="[('user_id','=',uid)]" icon="terp-personal"/>
|
||||
<filter string="My Entries" domain="[('user_id','=',uid)]"/>
|
||||
<field name="account_id"/>
|
||||
<field name="user_id"/>
|
||||
<group string="Group By..." expand="0">
|
||||
<filter string="Account" context="{'group_by':'account_id'}" icon="terp-folder-green"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
|
||||
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
|
||||
<filter string="Fin.Account" context="{'group_by':'general_account_id'}" icon="terp-folder-green"/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}" icon="terp-accessories-archiver"/>
|
||||
<filter string="Analytic Account" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Fin. Account" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" name="group_journal"/>
|
||||
<separator/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}"/>
|
||||
<filter string="User" context="{'group_by':'user_id'}"/>
|
||||
<separator/>
|
||||
<filter string="Date" context="{'group_by':'date'}" name="group_date"/>
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -357,16 +361,6 @@
|
||||
action="action_account_analytic_journal_tree"
|
||||
id="account_analytic_journal_print" parent="account.next_id_40"/>
|
||||
|
||||
|
||||
<act_window
|
||||
context="{'search_default_account_id': [active_id], 'search_default_user_id': False, 'default_account_id': active_id}"
|
||||
id="act_acc_analytic_acc_5_report_hr_timesheet_invoice_journal"
|
||||
name="All Analytic Entries"
|
||||
res_model="account.analytic.line"
|
||||
src_model="account.analytic.account"
|
||||
view_mode="tree,form"
|
||||
view_type="form"/>
|
||||
|
||||
<record id="view_account_journal_1" model="ir.ui.view">
|
||||
<field name="name">account.journal.form.1</field>
|
||||
<field name="model">account.journal</field>
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
Analytic Account form
|
||||
-->
|
||||
|
||||
<act_window
|
||||
id="action_sales_order"
|
||||
name="Sales Orders"
|
||||
res_model="sale.order"
|
||||
src_model="account.analytic.account"
|
||||
/>
|
||||
<record model="ir.actions.act_window" id="action_sales_order">
|
||||
<field name="name">Sales Orders</field>
|
||||
<field name="res_model">sale.order</field>
|
||||
<field name="src_model">account.analytic.account</field>
|
||||
</record>
|
||||
|
||||
<record id="account_analytic_account_form_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.invoice.form.inherit</field>
|
||||
|
||||
@@ -213,8 +213,6 @@ class account_followup_print_all(osv.osv_memory):
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
move_obj = self.pool.get('account.move.line')
|
||||
user_obj = self.pool.get('res.users')
|
||||
line_obj = self.pool.get('account_followup.stat')
|
||||
mail_message = self.pool.get('mail.message')
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -241,7 +239,6 @@ class account_followup_print_all(osv.osv_memory):
|
||||
if (not dest) and partner.type=='default':
|
||||
if partner.email:
|
||||
dest = [partner.email]
|
||||
src = tools.config.options['email_from']
|
||||
if not data.partner_lang:
|
||||
body = data.email_body
|
||||
else:
|
||||
@@ -281,7 +278,12 @@ class account_followup_print_all(osv.osv_memory):
|
||||
msg = ''
|
||||
if dest:
|
||||
try:
|
||||
mail_message.schedule_with_attach(cr, uid, src, dest, sub, body, context=context)
|
||||
vals = {'state': 'outgoing',
|
||||
'subject': sub,
|
||||
'body_html': '<pre>%s</pre>' % body,
|
||||
'email_to': dest,
|
||||
'email_from': data_user.email or tools.config.options['email_from']}
|
||||
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
|
||||
msg_sent += partner.name + '\n'
|
||||
except Exception, e:
|
||||
raise osv.except_osv('Error !', e )
|
||||
|
||||
@@ -8,12 +8,18 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Analytic Account" version="7.0">
|
||||
<sheet string="Analytic Account">
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
</div>
|
||||
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<div name="project"/>
|
||||
<group>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline"/>
|
||||
</h1>
|
||||
<div name="project"/>
|
||||
</div>
|
||||
|
||||
<group name="main">
|
||||
<group>
|
||||
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)" attrs="{'required':[('type','=','contract')]}"/>
|
||||
<field name="manager_id"/>
|
||||
|
||||
@@ -9,16 +9,13 @@
|
||||
<field name="email_from"><![CDATA[${object.company_id.name} <${object.company_id.email}>]]></field>
|
||||
<field name="email_to" eval="False"><!--(set by reset_password module)--></field>
|
||||
<field name="subject">Password reset</field>
|
||||
<field name="body"><![CDATA[
|
||||
A password reset was requested the OpenERP account linked to this email on ${object._auth_reset_password_host()}
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>A password reset was requested the OpenERP account linked to this email on ${object._auth_reset_password_host()}</p>
|
||||
|
||||
You may change your password following this link:
|
||||
<p>You may change your password following this <a href="${object._auth_reset_password_link()}">link</a>,
|
||||
or by copy-pasting the following URL in your browser: ${object._auth_reset_password_link()}</p>
|
||||
|
||||
${object._auth_reset_password_link()}
|
||||
|
||||
If you don't have asked for password reset, you can safely ignore this email.
|
||||
|
||||
]]></field>
|
||||
<p>Note: If you did not ask for a password reset, you can safely ignore this email.</p>]]></field>
|
||||
</record>
|
||||
|
||||
<!-- TODO get own css -->
|
||||
|
||||
@@ -302,33 +302,27 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
||||
return self.format_body(body % data)
|
||||
|
||||
def email_send(self, cr, uid, obj, emails, body, emailfrom=None, context=None):
|
||||
""" send email
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param email: pass the emails
|
||||
@param emailfrom: Pass name the email From else False
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
if not emailfrom:
|
||||
emailfrom = tools.config.get('email_from', False)
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
mail_message = self.pool.get('mail.message')
|
||||
emailfrom = tools.config.get('email_from')
|
||||
body = self.format_mail(obj, body)
|
||||
if not emailfrom:
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.email:
|
||||
emailfrom = obj.user_id.email
|
||||
|
||||
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
|
||||
if not emailfrom and hasattr(obj, 'user_id') and obj.user_id and obj.user_id.email:
|
||||
emailfrom = obj.user_id.email
|
||||
emailfrom = tools.ustr(emailfrom)
|
||||
reply_to = emailfrom
|
||||
if not emailfrom:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_("No email ID found for your company address."))
|
||||
return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, res_id=obj.id)
|
||||
_("Missing default email address or missing email on responsible user"))
|
||||
return self.pool.get('mail.mail').create(cr, uid,
|
||||
{ 'email_from': emailfrom,
|
||||
'email_to': emails.join(','),
|
||||
'reply_to': reply_to,
|
||||
'state': 'outgoing',
|
||||
'subject': '[%d] %s' % (obj.id, tools.ustr(obj.name)),
|
||||
'body_html': '<pre>%s</pre>' % body,
|
||||
'res_id': obj.id,
|
||||
'model': obj._table_name,
|
||||
'auto_delete': True
|
||||
}, context=context)
|
||||
|
||||
|
||||
def do_check(self, cr, uid, action, obj, context=None):
|
||||
|
||||
@@ -0,0 +1,536 @@
|
||||
# Norwegian Bokmal translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-03 16:43+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_to_user:0
|
||||
msgid ""
|
||||
"Check this if you want the rule to send an email to the responsible person."
|
||||
msgstr ""
|
||||
"Sjekk dette hvis du vil at regelen skal sende en e-post til ansvarlig person."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_remind_partner:0
|
||||
msgid "Remind Partner"
|
||||
msgstr "Påminn partner"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_partner_categ_id:0
|
||||
msgid "Partner Category"
|
||||
msgstr "Partner Kategori"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_mail_to_watchers:0
|
||||
msgid "Mail to Watchers (CC)"
|
||||
msgstr "Post til overvåkere (CC)"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_state_to:0
|
||||
msgid "Button Pressed"
|
||||
msgstr "Knapp trykket"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,model_id:0
|
||||
msgid "Object"
|
||||
msgstr "Objekt"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_mail_to_email:0
|
||||
msgid "Mail to these Emails"
|
||||
msgstr "Send mail til disse e-postene"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_state:0
|
||||
msgid "Set State to"
|
||||
msgstr "Still stat til"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_email_from:0
|
||||
msgid "Email From"
|
||||
msgstr "E-post fra"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Email Body"
|
||||
msgstr "E-post kropp"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_range_type:0
|
||||
msgid "Days"
|
||||
msgstr "Dager"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,last_run:0
|
||||
msgid "Last Run"
|
||||
msgstr "Siste kjøring"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: code:addons/base_action_rule/base_action_rule.py:328
|
||||
#, python-format
|
||||
msgid "Error!"
|
||||
msgstr "Feil!"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_reply_to:0
|
||||
msgid "Reply-To"
|
||||
msgstr "Svar til"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_email_cc:0
|
||||
msgid ""
|
||||
"These people will receive a copy of the future communication between partner "
|
||||
"and users by email"
|
||||
msgstr ""
|
||||
"Disse menneskene vil motta en kopi av den fremtidige kommunikasjon mellom "
|
||||
"partner og brukere av e-post"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_range_type:0
|
||||
msgid "Minutes"
|
||||
msgstr "Minutter"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,name:0
|
||||
msgid "Rule Name"
|
||||
msgstr "Regelnavn"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_remind_partner:0
|
||||
msgid ""
|
||||
"Check this if you want the rule to send a reminder by email to the partner."
|
||||
msgstr ""
|
||||
"Sjekk dette hvis du vil at regelen skal sende en påminnelse via e-post til "
|
||||
"partneren."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Conditions on Model Partner"
|
||||
msgstr "Forholdene på Modell Partner"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_type:0
|
||||
msgid "Deadline"
|
||||
msgstr "Frist"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_partner_id:0
|
||||
msgid "Partner"
|
||||
msgstr "Partner"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_subject)s = Object subject"
|
||||
msgstr "%(object_subject)s = Object subject"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Email Reminders"
|
||||
msgstr "E-post påminnelser"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Special Keywords to be Used in the Body"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_state_from:0
|
||||
msgid "State"
|
||||
msgstr "Stat"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: model:ir.actions.act_window,help:base_action_rule.base_action_rule_act
|
||||
msgid ""
|
||||
"Use automated actions to automatically trigger actions for various screens. "
|
||||
"Example: a lead created by a specific user may be automatically set to a "
|
||||
"specific sales team, or an opportunity which still has status pending after "
|
||||
"14 days might trigger an automatic reminder email."
|
||||
msgstr ""
|
||||
"Bruke automatiserte tiltak for å automatisk utløse tiltak for ulike "
|
||||
"skjermer. Eksempel: en leder er opprettet av en bestemt bruker kan bli satt "
|
||||
"automatisk til en bestemt salgsteam, eller en mulighet som fortsatt har "
|
||||
"status påvente etter 14 dager kan utløse en automatisk påminnelse e-post."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_to_email:0
|
||||
msgid "Email-id of the persons whom mail is to be sent"
|
||||
msgstr "E-post ID av personer som post skal sendes"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Action Rule"
|
||||
msgstr "Handling regel"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Fields to Change"
|
||||
msgstr "Felter å endre"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_type:0
|
||||
msgid "Creation Date"
|
||||
msgstr "Opprettelsesdato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_type:0
|
||||
msgid "Last Action Date"
|
||||
msgstr "Siste handlingsdato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_range_type:0
|
||||
msgid "Hours"
|
||||
msgstr "Timer"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_id)s = Object ID"
|
||||
msgstr "%(object_ID)s = Object ID"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Delay After Trigger Date"
|
||||
msgstr "Forsinkelse Etter utløser Dato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_remind_attach:0
|
||||
msgid "Remind with Attachment"
|
||||
msgstr "Minn med vedlegg"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: constraint:ir.cron:0
|
||||
msgid "Invalid arguments"
|
||||
msgstr "Ugyldige argumenter"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_user_id:0
|
||||
msgid "Set Responsible to"
|
||||
msgstr "Satt Ansvarlig for å"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_type:0
|
||||
msgid "None"
|
||||
msgstr "Ingen"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_email_to:0
|
||||
msgid ""
|
||||
"Use a python expression to specify the right field on which one than we will "
|
||||
"use for the 'To' field of the header"
|
||||
msgstr ""
|
||||
"Bruk en python uttrykk for å angi høyre feltet på hvilken enn vi vil bruke "
|
||||
"for Til-feltet på header."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_user_phone)s = Responsible phone"
|
||||
msgstr "% (object_bruker_telefonen) s = Ansvarlig telefon"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid ""
|
||||
"The rule uses the AND operator. The model must match all non-empty fields so "
|
||||
"that the rule executes the action described in the 'Actions' tab."
|
||||
msgstr ""
|
||||
"Regelen bruker AND-operatoren. Modellen må matche alle-ikke tomme felt, slik "
|
||||
"at regelen utfører handlingen som er beskrevet i \"Handlinger\"-fanen."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_date_range_type:0
|
||||
msgid "Delay type"
|
||||
msgstr "forsinkelse typen"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,regex_name:0
|
||||
msgid ""
|
||||
"Regular expression for matching name of the resource\n"
|
||||
"e.g.: 'urgent.*' will search for records having name starting with the "
|
||||
"string 'urgent'\n"
|
||||
"Note: This is case sensitive search."
|
||||
msgstr ""
|
||||
"Regulært uttrykk for matchende navnet på ressursen\n"
|
||||
"f.eks: \". haster * 'vil søke etter poster som har navn som starter med "
|
||||
"strengen\" haster \"\n"
|
||||
"Merk: Dette er små bokstaver søk."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_method:0
|
||||
msgid "Call Object Method"
|
||||
msgstr "Kall objektmetode"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_email_to:0
|
||||
msgid "Email To"
|
||||
msgstr "E-post til."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_to_watchers:0
|
||||
msgid ""
|
||||
"Check this if you want the rule to mark CC(mail to any other person defined "
|
||||
"in actions)."
|
||||
msgstr ""
|
||||
"Sjekk dette hvis du vil at regelen skal merkes CC (mail til en annen person "
|
||||
"som er definert i handlinger)."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(partner)s = Partner name"
|
||||
msgstr "%(partner)s = Navn på partner"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Note"
|
||||
msgstr "Notat"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_email_from:0
|
||||
msgid ""
|
||||
"Use a python expression to specify the right field on which one than we will "
|
||||
"use for the 'From' field of the header"
|
||||
msgstr ""
|
||||
"Bruk en python uttrykk for å angi høyre feltet på hvilken enn vi vil bruke "
|
||||
"for Fra-feltet på overskriften"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_date_range:0
|
||||
msgid "Delay after trigger date"
|
||||
msgstr "Forsinkelse etter triggerdato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Conditions"
|
||||
msgstr "Betingelser"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,trg_date_range:0
|
||||
msgid ""
|
||||
"Delay After Trigger Date,specifies you can put a negative number. If you "
|
||||
"need a delay before the trigger date, like sending a reminder 15 minutes "
|
||||
"before a meeting."
|
||||
msgstr ""
|
||||
"Forsinkelse Etter utløser Dato, spesifiserer du kan sette et negativt tall. "
|
||||
"Hvis du trenger en forsinkelse før avtrekkeren dato, som å sende en "
|
||||
"påminnelse 15 minutter før et møte."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,active:0
|
||||
msgid "Active"
|
||||
msgstr "Aktiv"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: code:addons/base_action_rule/base_action_rule.py:329
|
||||
#, python-format
|
||||
msgid "No Email ID Found for your Company address!"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_remind_user:0
|
||||
msgid "Remind Responsible"
|
||||
msgstr "Minn Ansvarlig"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,sequence:0
|
||||
msgid "Gives the sequence order when displaying a list of rules."
|
||||
msgstr "Gir sekvens ordre når du viser en liste over regler."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_range_type:0
|
||||
msgid "Months"
|
||||
msgstr "Måneder"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,filter_id:0
|
||||
msgid "Filter"
|
||||
msgstr "Filtrer"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: selection:base.action.rule,trg_date_type:0
|
||||
msgid "Date"
|
||||
msgstr "Dato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,server_action_id:0
|
||||
msgid ""
|
||||
"Describes the action name.\n"
|
||||
"eg:on which object which action to be taken on basis of which condition"
|
||||
msgstr ""
|
||||
"Beskriver handlingens navn.\n"
|
||||
"f.eks: på hvilket objekt som tiltak som skal iverksettes på grunnlag av "
|
||||
"hvilken tilstand"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: model:ir.model,name:base_action_rule.model_ir_cron
|
||||
msgid "ir.cron"
|
||||
msgstr "ir.actions.actions"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_description)s = Object description"
|
||||
msgstr "% (object_beskrivelse) s = Object beskrivelse"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: constraint:base.action.rule:0
|
||||
msgid "Error: The mail is not well formated"
|
||||
msgstr "Feil: E-posten er ikke godt nok formatert"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Email Actions"
|
||||
msgstr "E-post handlinger"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Email Information"
|
||||
msgstr "E-post Informasjon"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: model:ir.model,name:base_action_rule.model_base_action_rule
|
||||
msgid "Action Rules"
|
||||
msgstr "Handlingsregler"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_body:0
|
||||
msgid "Content of mail"
|
||||
msgstr "Innholdet av post"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_user_id:0
|
||||
msgid "Responsible"
|
||||
msgstr "Ansvarlig"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(partner_email)s = Partner Email"
|
||||
msgstr "% (partner_e-post) s = Partner E-post"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_date)s = Creation date"
|
||||
msgstr "%(object_dato)s = opprettelsesdato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_user_email)s = Responsible Email"
|
||||
msgstr "% (object_brukerens_e-post) s = Ansvarlig e-post"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_mail_body:0
|
||||
msgid "Mail body"
|
||||
msgstr "Mail kropp"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_remind_user:0
|
||||
msgid ""
|
||||
"Check this if you want the rule to send a reminder by email to the user."
|
||||
msgstr ""
|
||||
"Kryss av her hvis du vil at regelen skal sende en påminnelse til brukeren "
|
||||
"via e-post."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Server Action to be Triggered"
|
||||
msgstr "Server Tiltak som skal Utløses"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_mail_to_user:0
|
||||
msgid "Mail to Responsible"
|
||||
msgstr "send mail til ansvarlig"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_email_cc:0
|
||||
msgid "Add Watchers (Cc)"
|
||||
msgstr "Legg til overvåkere (Cc)"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Conditions on Model Fields"
|
||||
msgstr "Forholdene på Modell Felter"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: model:ir.actions.act_window,name:base_action_rule.base_action_rule_act
|
||||
#: model:ir.ui.menu,name:base_action_rule.menu_base_action_rule_form
|
||||
msgid "Automated Actions"
|
||||
msgstr "Automatiserte handinger"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,server_action_id:0
|
||||
msgid "Server Action"
|
||||
msgstr "Tjenerhandling"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,regex_name:0
|
||||
msgid "Regex on Resource Name"
|
||||
msgstr "Regex på Ressursnavn"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_remind_attach:0
|
||||
msgid ""
|
||||
"Check this if you want that all documents attached to the object be attached "
|
||||
"to the reminder email sent."
|
||||
msgstr ""
|
||||
"Kryss av her om du vil at alle dokumenter knyttet til objektet festes til "
|
||||
"påminnelse e-post sendt."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Conditions on Timing"
|
||||
msgstr "Vilkår for timing"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr "Sekvens"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Actions"
|
||||
msgstr "Handlinger"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,active:0
|
||||
msgid ""
|
||||
"If the active field is set to False, it will allow you to hide the rule "
|
||||
"without removing it."
|
||||
msgstr ""
|
||||
"Hvis det aktive feltet er satt til False, vil det tillate deg å skjule "
|
||||
"regelen uten å fjerne den."
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "%(object_user)s = Responsible name"
|
||||
msgstr "% (object_bruker) s = Ansvarlig navn"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,create_date:0
|
||||
msgid "Create Date"
|
||||
msgstr "Opprettet dato"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: view:base.action.rule:0
|
||||
msgid "Conditions on States"
|
||||
msgstr "Vilkår for tilstander"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,trg_date_type:0
|
||||
msgid "Trigger Date"
|
||||
msgstr "Uttløser dato"
|
||||
|
||||
#~ msgid "Special Keywords to Be Used in The Body"
|
||||
#~ msgstr "Spesielle nøkkelord for bruk i meldingsinnhold"
|
||||
|
||||
#, python-format
|
||||
#~ msgid "No E-Mail ID Found for your Company address!"
|
||||
#~ msgstr "Ingen E-post ID funnet for din firmaadresse!"
|
||||
@@ -471,18 +471,10 @@ property or property parameter."),
|
||||
def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context=None):
|
||||
"""
|
||||
Send mail for event invitation to event attendees.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of attendee’s IDs.
|
||||
@param email_from: Email address for user sending the mail
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: True
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name
|
||||
mail_message = self.pool.get('mail.message')
|
||||
for att in self.browse(cr, uid, ids, context=context):
|
||||
sign = att.sent_by_uid and att.sent_by_uid.signature or ''
|
||||
sign = '<br>'.join(sign and sign.split('\n') or [])
|
||||
@@ -508,17 +500,18 @@ property or property parameter."),
|
||||
}
|
||||
body = html_invitation % body_vals
|
||||
if mail_to and email_from:
|
||||
attach = self.get_ics_file(cr, uid, res_obj, context=context)
|
||||
mail_message.schedule_with_attach(cr, uid,
|
||||
email_from,
|
||||
mail_to,
|
||||
sub,
|
||||
body,
|
||||
attachments=attach and {'invitation.ics': attach} or None,
|
||||
content_subtype='html',
|
||||
reply_to=email_from,
|
||||
context=context
|
||||
)
|
||||
ics_file = self.get_ics_file(cr, uid, res_obj, context=context)
|
||||
vals = {'email_from': email_from,
|
||||
'email_to': mail_to,
|
||||
'state': 'outgoing',
|
||||
'subject': sub,
|
||||
'body_html': body,
|
||||
'auto_delete': True}
|
||||
if ics_file:
|
||||
vals['attachment_ids'] = [(0,0,{'name': 'invitation.ics',
|
||||
'datas_fname': 'invitation.ics',
|
||||
'datas': str(ics_file).encode('base64')})]
|
||||
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
|
||||
return True
|
||||
|
||||
def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv):
|
||||
@@ -812,7 +805,6 @@ class calendar_alarm(osv.osv):
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
mail_message = self.pool.get('mail.message')
|
||||
current_datetime = datetime.now()
|
||||
alarm_ids = self.search(cr, uid, [('state', '!=', 'done')], context=context)
|
||||
|
||||
@@ -849,36 +841,10 @@ class calendar_alarm(osv.osv):
|
||||
else:
|
||||
re_dates = [alarm.trigger_date]
|
||||
|
||||
for r_date in re_dates:
|
||||
ref = alarm.model_id.model + ',' + str(alarm.res_id)
|
||||
|
||||
# search for alreay sent requests
|
||||
#if request_obj.search(cr, uid, [('trigger_date', '=', r_date), ('ref_doc1', '=', ref)], context=context):
|
||||
#continue
|
||||
|
||||
# Deactivated because of the removing of res.request
|
||||
# TODO: when cleaning calendar module, re-add this in a new mechanism
|
||||
#if alarm.action == 'display':
|
||||
#value = {
|
||||
#'name': alarm.name,
|
||||
#'act_from': alarm.user_id.id,
|
||||
#'act_to': alarm.user_id.id,
|
||||
#'body': alarm.description,
|
||||
#'trigger_date': r_date,
|
||||
#'ref_doc1': ref
|
||||
#}
|
||||
#request_id = request_obj.create(cr, uid, value)
|
||||
#request_ids = [request_id]
|
||||
#for attendee in res_obj.attendee_ids:
|
||||
#if attendee.user_id:
|
||||
#value['act_to'] = attendee.user_id.id
|
||||
#request_id = request_obj.create(cr, uid, value)
|
||||
#request_ids.append(request_id)
|
||||
#request_obj.request_send(cr, uid, request_ids)
|
||||
|
||||
if re_dates:
|
||||
if alarm.action == 'email':
|
||||
sub = '[Openobject Reminder] %s' % (alarm.name)
|
||||
body = """
|
||||
sub = '[OpenERP Reminder] %s' % (alarm.name)
|
||||
body = """<pre>
|
||||
Event: %s
|
||||
Event Date: %s
|
||||
Description: %s
|
||||
@@ -888,20 +854,21 @@ From:
|
||||
|
||||
----
|
||||
%s
|
||||
|
||||
</pre>
|
||||
""" % (alarm.name, alarm.trigger_date, alarm.description, \
|
||||
alarm.user_id.name, alarm.user_id.signature)
|
||||
mail_to = [alarm.user_id.email]
|
||||
for att in alarm.attendee_ids:
|
||||
mail_to.append(att.user_id.email)
|
||||
if mail_to:
|
||||
mail_message.schedule_with_attach(cr, uid,
|
||||
tools.config.get('email_from', False),
|
||||
mail_to,
|
||||
sub,
|
||||
body,
|
||||
context=context
|
||||
)
|
||||
vals = {
|
||||
'state': 'outgoing',
|
||||
'subject': sub,
|
||||
'body_html': body,
|
||||
'email_to': mail_to,
|
||||
'email_from': tools.config.get('email_from', mail_to),
|
||||
}
|
||||
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
|
||||
if next_trigger_date:
|
||||
update_vals.update({'trigger_date': next_trigger_date})
|
||||
else:
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
# Norwegian Bokmal translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-04 13:40+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-05 04:46+0000\n"
|
||||
"X-Generator: Launchpad (build 15901)\n"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,category:0
|
||||
msgid "Category"
|
||||
msgstr "Kategori"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,save:0
|
||||
msgid "Information"
|
||||
msgstr "Informasjon"
|
||||
|
||||
#. module: base_module_record
|
||||
#: model:ir.model,name:base_module_record.model_ir_module_record
|
||||
msgid "ir.module.record"
|
||||
msgstr "ir.modul.opptak"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_data,info,end:0
|
||||
#: wizard_button:base_module_record.module_record_data,save_yaml,end:0
|
||||
msgid "End"
|
||||
msgstr "Slutt"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_data,init:0
|
||||
#: wizard_view:base_module_record.module_record_objects,init:0
|
||||
msgid "Choose objects to record"
|
||||
msgstr "Velg objekter til opptak"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,author:0
|
||||
msgid "Author"
|
||||
msgstr "Forfatter"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,directory_name:0
|
||||
msgid "Directory Name"
|
||||
msgstr "Navn på katalog"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_data,init,filter_cond:0
|
||||
#: wizard_field:base_module_record.module_record_objects,init,filter_cond:0
|
||||
msgid "Records only"
|
||||
msgstr "Bare opptak"
|
||||
|
||||
#. module: base_module_record
|
||||
#: selection:base_module_record.module_record_objects,info,data_kind:0
|
||||
msgid "Demo Data"
|
||||
msgstr "Demo data"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,save,module_filename:0
|
||||
msgid "Filename"
|
||||
msgstr "Filnavn"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,version:0
|
||||
msgid "Version"
|
||||
msgstr "Versjon"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_data,info:0
|
||||
#: wizard_view:base_module_record.module_record_data,init:0
|
||||
#: wizard_view:base_module_record.module_record_data,save_yaml:0
|
||||
#: wizard_view:base_module_record.module_record_objects,init:0
|
||||
msgid "Objects Recording"
|
||||
msgstr "objekter Innspilling"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,save:0
|
||||
msgid ""
|
||||
"If you think your module could interest other people, we'd like you to "
|
||||
"publish it on http://www.openerp.com, in the 'Modules' section. You can do "
|
||||
"it through the website or using features of the 'base_module_publish' module."
|
||||
msgstr ""
|
||||
"Hvis du tror din modul kan interessere andre mennesker, vil vi gjerne at du "
|
||||
"publisere den på http://www.openerp.com, i 'Moduler-delen. Du kan gjøre det "
|
||||
"gjennom nettstedet eller bruke funksjonene i «base_module_publish»-modulen."
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_data,init,check_date:0
|
||||
#: wizard_field:base_module_record.module_record_objects,init,check_date:0
|
||||
msgid "Record from Date"
|
||||
msgstr "Dato fra opptak"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_data,end:0
|
||||
#: wizard_view:base_module_record.module_record_objects,end:0
|
||||
#: wizard_view:base_module_record.module_record_objects,info:0
|
||||
#: wizard_view:base_module_record.module_record_objects,save:0
|
||||
#: wizard_view:base_module_record.module_record_objects,save_yaml:0
|
||||
msgid "Module Recording"
|
||||
msgstr "Modul innspilling"
|
||||
|
||||
#. module: base_module_record
|
||||
#: model:ir.actions.wizard,name:base_module_record.wizard_base_module_record_objects
|
||||
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_record_objects
|
||||
msgid "Export Customizations As a Module"
|
||||
msgstr "Eksporter Tilpasninger som en modul"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,save:0
|
||||
msgid "Thanks in advance for your contribution."
|
||||
msgstr "Takk på forhånd for ditt bidrag."
|
||||
|
||||
#. module: base_module_record
|
||||
#: help:base_module_record.module_record_data,init,objects:0
|
||||
#: help:base_module_record.module_record_objects,init,objects:0
|
||||
msgid "List of objects to be recorded"
|
||||
msgstr "Liste over objekter som skal spilles inn"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,description:0
|
||||
msgid "Full Description"
|
||||
msgstr "Full beskrivelse"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,name:0
|
||||
msgid "Module Name"
|
||||
msgstr "Modulnavn"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_data,init,objects:0
|
||||
#: wizard_field:base_module_record.module_record_objects,init,objects:0
|
||||
msgid "Objects"
|
||||
msgstr "Objekter"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,save,module_file:0
|
||||
#: wizard_field:base_module_record.module_record_objects,save_yaml,yaml_file:0
|
||||
msgid "Module .zip File"
|
||||
msgstr "Modul .zip fil"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,save:0
|
||||
msgid "Module successfully created!"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,save_yaml:0
|
||||
msgid "YAML file successfully created !"
|
||||
msgstr "YAML fil opprettet!"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_data,info:0
|
||||
#: wizard_view:base_module_record.module_record_data,save_yaml:0
|
||||
msgid "Result, paste this to your module's xml"
|
||||
msgstr "Resultatet, lim denne til modulen xml"
|
||||
|
||||
#. module: base_module_record
|
||||
#: selection:base_module_record.module_record_data,init,filter_cond:0
|
||||
#: selection:base_module_record.module_record_objects,init,filter_cond:0
|
||||
msgid "Created"
|
||||
msgstr "Opprettet"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_data,end:0
|
||||
#: wizard_view:base_module_record.module_record_objects,end:0
|
||||
msgid "Thanks For using Module Recorder"
|
||||
msgstr "Takk for at du brukte Modul opptaker."
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,website:0
|
||||
msgid "Documentation URL"
|
||||
msgstr "Dokumentasjon URL"
|
||||
|
||||
#. module: base_module_record
|
||||
#: selection:base_module_record.module_record_data,init,filter_cond:0
|
||||
#: selection:base_module_record.module_record_objects,init,filter_cond:0
|
||||
msgid "Modified"
|
||||
msgstr "Modifisert"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_data,init,record:0
|
||||
#: wizard_button:base_module_record.module_record_objects,init,record:0
|
||||
msgid "Record"
|
||||
msgstr "Opptak"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_objects,info,save:0
|
||||
msgid "Continue"
|
||||
msgstr "Fortsett"
|
||||
|
||||
#. module: base_module_record
|
||||
#: model:ir.actions.wizard,name:base_module_record.wizard_base_module_record_data
|
||||
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_record_data
|
||||
msgid "Export Customizations As Data File"
|
||||
msgstr "Eksport Tilpasninger Som datafil"
|
||||
|
||||
#. module: base_module_record
|
||||
#: code:addons/base_module_record/wizard/base_module_save.py:129
|
||||
#, python-format
|
||||
msgid "Error"
|
||||
msgstr "Feil"
|
||||
|
||||
#. module: base_module_record
|
||||
#: selection:base_module_record.module_record_objects,info,data_kind:0
|
||||
msgid "Normal Data"
|
||||
msgstr "Normal data"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_data,end,end:0
|
||||
#: wizard_button:base_module_record.module_record_objects,end,end:0
|
||||
msgid "OK"
|
||||
msgstr "Ok"
|
||||
|
||||
#. module: base_module_record
|
||||
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_mod_rec
|
||||
msgid "Module Creation"
|
||||
msgstr "modul Skapelsen"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_objects,info,data_kind:0
|
||||
msgid "Type of Data"
|
||||
msgstr "Type data"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_view:base_module_record.module_record_objects,info:0
|
||||
msgid "Module Information"
|
||||
msgstr "Modul informasjon"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_data,init,info_yaml:0
|
||||
#: wizard_field:base_module_record.module_record_objects,init,info_yaml:0
|
||||
msgid "YAML"
|
||||
msgstr "YAML"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_field:base_module_record.module_record_data,info,res_text:0
|
||||
#: wizard_field:base_module_record.module_record_data,save_yaml,res_text:0
|
||||
msgid "Result"
|
||||
msgstr "Resultat"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_data,init,end:0
|
||||
#: wizard_button:base_module_record.module_record_objects,info,end:0
|
||||
#: wizard_button:base_module_record.module_record_objects,init,end:0
|
||||
msgid "Cancel"
|
||||
msgstr "Kanseller"
|
||||
|
||||
#. module: base_module_record
|
||||
#: wizard_button:base_module_record.module_record_objects,save,end:0
|
||||
#: wizard_button:base_module_record.module_record_objects,save_yaml,end:0
|
||||
msgid "Close"
|
||||
msgstr "Lukke"
|
||||
|
||||
#. module: base_module_record
|
||||
#: selection:base_module_record.module_record_data,init,filter_cond:0
|
||||
#: selection:base_module_record.module_record_objects,init,filter_cond:0
|
||||
msgid "Created & Modified"
|
||||
msgstr "Laget & Modifisert"
|
||||
|
||||
#~ msgid "Module successfully created !"
|
||||
#~ msgstr "Modulen opprettet!"
|
||||
@@ -0,0 +1,204 @@
|
||||
# Norwegian Bokmal translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-04 13:59+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-05 04:46+0000\n"
|
||||
"X-Generator: Launchpad (build 15901)\n"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.model,name:base_report_designer.model_base_report_sxw
|
||||
msgid "base.report.sxw"
|
||||
msgstr "basen.rapport.sxw"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "OpenERP Report Designer Configuration"
|
||||
msgstr "OpenERP Rapport Designer Konfigurasjon"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid ""
|
||||
"This plug-in allows you to create/modify OpenERP Reports into OpenOffice "
|
||||
"Writer."
|
||||
msgstr ""
|
||||
"Denne plug-in tillater deg å lage / endre OpenERP rapporter i OpenOffice "
|
||||
"Writer."
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.file.sxw:0
|
||||
msgid "Upload the modified report"
|
||||
msgstr "Laste opp den endrede rapporten"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.file.sxw:0
|
||||
msgid "The .SXW report"
|
||||
msgstr ".SXW rapport"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.model,name:base_report_designer.model_base_report_designer_installer
|
||||
msgid "base_report_designer.installer"
|
||||
msgstr "basen.rapport.designer.installatør"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "_Close"
|
||||
msgstr "_Lukk"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.rml.save:0
|
||||
msgid "The RML Report"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "Configure"
|
||||
msgstr "Konfigurer"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "title"
|
||||
msgstr "tittel"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base.report.file.sxw,report_id:0
|
||||
#: field:base.report.sxw,report_id:0
|
||||
msgid "Report"
|
||||
msgstr "Rapport"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.model,name:base_report_designer.model_base_report_rml_save
|
||||
msgid "base.report.rml.save"
|
||||
msgstr "Basen.rapport.rml.lagre"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.ui.menu,name:base_report_designer.menu_action_report_designer_wizard
|
||||
msgid "Report Designer"
|
||||
msgstr "Rapportdesigner"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base_report_designer.installer,name:0
|
||||
msgid "File name"
|
||||
msgstr "Filnavn"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.file.sxw:0
|
||||
#: view:base.report.sxw:0
|
||||
msgid "Get a report"
|
||||
msgstr "Få en rapport"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
#: model:ir.actions.act_window,name:base_report_designer.action_report_designer_wizard
|
||||
msgid "OpenERP Report Designer"
|
||||
msgstr "OpenERP Rapport designer"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.sxw:0
|
||||
msgid "Continue"
|
||||
msgstr "Fortsett"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base.report.rml.save,file_rml:0
|
||||
msgid "Save As"
|
||||
msgstr "Lagre som"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: help:base_report_designer.installer,plugin_file:0
|
||||
msgid ""
|
||||
"OpenObject Report Designer plug-in file. Save as this file and install this "
|
||||
"plug-in in OpenOffice."
|
||||
msgstr ""
|
||||
"OpenObject Report Designer plug-in-filen. Lagre som denne filen og "
|
||||
"installere denne plugin-modulen i OpenOffice."
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.rml.save:0
|
||||
msgid "Save RML FIle"
|
||||
msgstr "Lagre RML fil"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base.report.file.sxw,file_sxw:0
|
||||
#: field:base.report.file.sxw,file_sxw_upload:0
|
||||
msgid "Your .SXW file"
|
||||
msgstr "Din .SXW fil"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "Installation and Configuration Steps"
|
||||
msgstr "Installasjon og Konfigurasjon trinn"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base_report_designer.installer,description:0
|
||||
msgid "Description"
|
||||
msgstr "Beskrivelse:"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.file.sxw:0
|
||||
msgid ""
|
||||
"This is the template of your requested report.\n"
|
||||
"Save it as a .SXW file and open it with OpenOffice.\n"
|
||||
"Don't forget to install the OpenERP SA OpenOffice package to modify it.\n"
|
||||
"Once it is modified, re-upload it in OpenERP using this wizard."
|
||||
msgstr ""
|
||||
"Dette er malen for den forespurte rapporten.\n"
|
||||
"Lagre det som en. Sxw fil og åpne den med OpenOffice.\n"
|
||||
"Ikke glem å installere OpenERP SA OpenOffice-pakken til å endre det.\n"
|
||||
"Når den er modifisert, laste opp det i OpenERP bruke denne veiviseren."
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base_report_designer.installer,config_logo:0
|
||||
msgid "Image"
|
||||
msgstr "Bilde"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.actions.act_window,name:base_report_designer.action_view_base_report_sxw
|
||||
msgid "Base Report sxw"
|
||||
msgstr "Basen rapport sxw"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.model,name:base_report_designer.model_base_report_file_sxw
|
||||
msgid "base.report.file.sxw"
|
||||
msgstr "basen.rapport.fil.sxw"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: field:base_report_designer.installer,plugin_file:0
|
||||
msgid "OpenObject Report Designer Plug-in"
|
||||
msgstr "OpenObject Rapport Designer Plug-in"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.actions.act_window,name:base_report_designer.action_report_designer_installer
|
||||
msgid "OpenERP Report Designer Installation"
|
||||
msgstr "OpenERP Rapport Designer Installasjon"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.file.sxw:0
|
||||
#: view:base.report.rml.save:0
|
||||
#: view:base.report.sxw:0
|
||||
#: view:base_report_designer.installer:0
|
||||
msgid "Cancel"
|
||||
msgstr "Kanseller"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: model:ir.model,name:base_report_designer.model_ir_actions_report_xml
|
||||
msgid "ir.actions.report.xml"
|
||||
msgstr "ir.handlinger.rapport.xml"
|
||||
|
||||
#. module: base_report_designer
|
||||
#: view:base.report.sxw:0
|
||||
msgid "Select your report"
|
||||
msgstr "Velg din rapport"
|
||||
|
||||
#~ msgid "The RML report"
|
||||
#~ msgstr "RML rapport"
|
||||
@@ -297,55 +297,31 @@ class base_stage(object):
|
||||
destination=False)
|
||||
|
||||
def remind_user(self, cr, uid, ids, context=None, attach=False, destination=True):
|
||||
mail_message = self.pool.get('mail.message')
|
||||
for case in self.browse(cr, uid, ids, context=context):
|
||||
if not destination and not case.email_from:
|
||||
return False
|
||||
if not case.user_id.email:
|
||||
return False
|
||||
if destination and case.section_id.user_id:
|
||||
case_email = case.section_id.user_id.email
|
||||
else:
|
||||
case_email = case.user_id.email
|
||||
|
||||
src = case_email
|
||||
dest = case.user_id.email or ""
|
||||
body = case.description or ""
|
||||
for message in case.message_ids:
|
||||
if message.email_from and message.body:
|
||||
body = message.body
|
||||
break
|
||||
|
||||
if not destination:
|
||||
src, dest = dest, case.email_from
|
||||
if body and case.user_id.signature:
|
||||
if body:
|
||||
body += '\n\n%s' % (case.user_id.signature)
|
||||
else:
|
||||
body = '\n\n%s' % (case.user_id.signature)
|
||||
|
||||
body = self.format_body(body)
|
||||
|
||||
attach_to_send = {}
|
||||
|
||||
if attach:
|
||||
attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', case.id)])
|
||||
attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname', 'datas'])
|
||||
attach_to_send = dict(map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send))
|
||||
|
||||
# Send an email
|
||||
subject = "Reminder: [%s] %s" % (str(case.id), case.name, )
|
||||
mail_message.schedule_with_attach(cr, uid,
|
||||
src,
|
||||
[dest],
|
||||
subject,
|
||||
body,
|
||||
model=self._name,
|
||||
reply_to=case.section_id.reply_to,
|
||||
res_id=case.id,
|
||||
attachments=attach_to_send,
|
||||
context=context
|
||||
)
|
||||
if 'message_post' in self:
|
||||
for case in self.browse(cr, uid, ids, context=context):
|
||||
if destination:
|
||||
recipient_id = case.user_id.partner_id.id
|
||||
else:
|
||||
if not case.email_from:
|
||||
return False
|
||||
recipient_id = self.pool.get('res.partner').find_or_create(cr, uid, case.email_from, context=context)
|
||||
|
||||
body = case.description or ""
|
||||
for message in case.message_ids:
|
||||
if message.type == 'email' and message.body:
|
||||
body = message.body
|
||||
break
|
||||
body = self.format_body(body)
|
||||
attach_to_send = {}
|
||||
if attach:
|
||||
attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', case.id)])
|
||||
attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname', 'datas'])
|
||||
attach_to_send = dict(map(lambda x: (x['datas_fname'], x['datas'].decode('base64')), attach_to_send))
|
||||
|
||||
subject = "Reminder: [%s] %s" % (case.id, case.name)
|
||||
self.message_post(cr, uid, case.id, body=body,
|
||||
subject=subject, attachments=attach_to_send,
|
||||
partner_ids=[recipient_id], context=context)
|
||||
return True
|
||||
|
||||
def _check(self, cr, uid, ids=False, context=None):
|
||||
@@ -360,17 +336,6 @@ class base_stage(object):
|
||||
def format_mail(self, obj, body):
|
||||
return self.pool.get('base.action.rule').format_mail(obj, body)
|
||||
|
||||
def message_thread_followers(self, cr, uid, ids, context=None):
|
||||
res = {}
|
||||
for case in self.browse(cr, uid, ids, context=context):
|
||||
l=[]
|
||||
if case.email_cc:
|
||||
l.append(case.email_cc)
|
||||
if case.user_id and case.user_id.email:
|
||||
l.append(case.user_id.email)
|
||||
res[case.id] = l
|
||||
return res
|
||||
|
||||
# ******************************
|
||||
# Notifications
|
||||
# ******************************
|
||||
@@ -401,13 +366,13 @@ class base_stage(object):
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
for id in ids:
|
||||
msg = _('%s has been <b>closed</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
|
||||
self.message_post(cr, uid, [id], body=msg, context=context)
|
||||
self.message_post(cr, uid, [id], body=msg, subtype="closed", context=context)
|
||||
return True
|
||||
|
||||
def case_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
for id in ids:
|
||||
msg = _('%s has been <b>canceled</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
|
||||
self.message_post(cr, uid, [id], body=msg, context=context)
|
||||
msg = _('%s has been <b>cancelled</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
|
||||
self.message_post(cr, uid, [id], body=msg, subtype="cancelled", context=context)
|
||||
return True
|
||||
|
||||
def case_pending_send_note(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -46,21 +46,11 @@ class base_action_rule(osv.osv):
|
||||
}
|
||||
|
||||
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context=None):
|
||||
mail_message = self.pool.get('mail.message')
|
||||
body = self.format_mail(obj, body)
|
||||
if not emailfrom:
|
||||
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.email:
|
||||
emailfrom = obj.user_id.email
|
||||
|
||||
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
|
||||
emailfrom = tools.ustr(emailfrom)
|
||||
if hasattr(obj, 'section_id') and obj.section_id and obj.section_id.alias_id:
|
||||
mail_id = super(base_action_rule, self).email_send(cr, uid, obj, emails, body, emailfrom=emailfrom, context=context)
|
||||
if mail_id and hasattr(obj, 'section_id') and obj.section_id and obj.section_id.alias_id:
|
||||
reply_to = obj.section_id.alias_id.name_get()[0][1]
|
||||
else:
|
||||
reply_to = emailfrom
|
||||
if not emailfrom:
|
||||
raise osv.except_osv(_('Error!'), _("There is no email for your company address."))
|
||||
return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model=obj._name, reply_to=reply_to, res_id=obj.id)
|
||||
self.pool.get('mail.mail').write(cr, uid, [mail_id], {'reply_to': reply_to}, context=context)
|
||||
return mail_id
|
||||
|
||||
def do_check(self, cr, uid, action, obj, context=None):
|
||||
ok = super(base_action_rule, self).do_check(cr, uid, action, obj, context=context)
|
||||
|
||||
@@ -671,24 +671,6 @@ class crm_lead(base_stage, osv.osv):
|
||||
partner_ids[lead.id] = partner_id
|
||||
return partner_ids
|
||||
|
||||
def _send_mail_to_salesman(self, cr, uid, lead, context=None):
|
||||
"""
|
||||
Send mail to salesman with updated Lead details.
|
||||
@ lead: browse record of 'crm.lead' object.
|
||||
"""
|
||||
#TOFIX: mail template should be used here instead of fix subject, body text.
|
||||
message = self.pool.get('mail.message')
|
||||
email_to = lead.user_id and lead.user_id.email
|
||||
if not email_to:
|
||||
return False
|
||||
|
||||
email_from = lead.section_id and lead.section_id.user_id and lead.section_id.user_id.email or email_to
|
||||
partner = lead.partner_id and lead.partner_id.name or lead.partner_name
|
||||
subject = "lead %s converted into opportunity" % lead.name
|
||||
body = "Info \n Id : %s \n Subject: %s \n Partner: %s \n Description : %s " % (lead.id, lead.name, lead.partner_id.name, lead.description)
|
||||
return message.schedule_with_attach(cr, uid, email_from, [email_to], subject, body)
|
||||
|
||||
|
||||
def allocate_salesman(self, cr, uid, ids, user_ids, team_id=False, context=None):
|
||||
index = 0
|
||||
for lead_id in ids:
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<field name="channel_id" ref="crm_case_channel_email"/>
|
||||
<field name="priority">1</field>
|
||||
<field name="section_id" ref="crm_case_section_4"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="stage_lead1"/>
|
||||
<field name="description">Hello,
|
||||
I am Jason from Le Club SARL,
|
||||
@@ -47,7 +47,7 @@ Can you send details,</field>
|
||||
<field name="channel_id" ref="crm_case_channel_website"/>
|
||||
<field name="priority">4</field>
|
||||
<field name="section_id" ref="crm_case_section_3"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="stage_lead1"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -108,7 +108,7 @@ Can you send details,</field>
|
||||
<field name="channel_id" ref="crm_case_channel_website"/>
|
||||
<field name="priority">3</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="stage_lead1"/>
|
||||
<field name="description">Hi, Can you send a quotation for 20 Computers with speakers?
|
||||
Regards,
|
||||
@@ -135,7 +135,7 @@ Contact: +1 813 494 5005</field>
|
||||
<field name="channel_id" ref=""/>
|
||||
<field name="priority">3</field>
|
||||
<field name="section_id" ref="crm_case_section_4"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="stage_lead1"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -194,7 +194,7 @@ Contact: +1 813 494 5005</field>
|
||||
<field name="channel_id" ref="crm_case_channel_phone"/>
|
||||
<field name="priority">2</field>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="stage_lead1"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -297,7 +297,7 @@ Andrew</field>
|
||||
<field eval="time.strftime('%Y-%m-12')" name="date_action"/>
|
||||
<field name="title_action">Meeting for pricing information.</field>
|
||||
<field name="section_id" ref="crm_case_section_3"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead3"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -342,7 +342,7 @@ Andrew</field>
|
||||
<field eval="time.strftime('%Y-%m-10')" name="date_action"/>
|
||||
<field name="title_action">Call to ask system requirement</field>
|
||||
<field name="section_id" ref="crm_case_section_3"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead4"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -411,7 +411,7 @@ Andrew</field>
|
||||
<field eval="time.strftime('%Y-%m-4')" name="date_action"/>
|
||||
<field name="title_action">Call to define real needs about training</field>
|
||||
<field name="section_id" ref="crm_case_section_2"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead3"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -434,7 +434,7 @@ Andrew</field>
|
||||
<field eval="time.strftime('%Y-%m-5')" name="date_action"/>
|
||||
<field name="title_action">Ask for the good receprion of the proposition</field>
|
||||
<field name="section_id" ref="crm_case_section_1"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead4"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -466,7 +466,7 @@ Andrew</field>
|
||||
<field name="channel_id" ref="crm_case_channel_phone"/>
|
||||
<field name="priority">3</field>
|
||||
<field name="section_id" ref="crm_case_section_4"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead8"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -484,7 +484,7 @@ Andrew</field>
|
||||
<field name="channel_id" ref="crm_case_channel_email"/>
|
||||
<field name="priority">3</field>
|
||||
<field name="section_id" ref="crm_case_section_4"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead8"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -519,7 +519,7 @@ Andrew</field>
|
||||
<field name="priority">5</field>
|
||||
<field eval="time.strftime('%Y-%m-6')" name="date_deadline"/>
|
||||
<field name="section_id" ref="section_sales_department"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead6"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
@@ -542,7 +542,7 @@ Andrew</field>
|
||||
<field name="priority">2</field>
|
||||
<field name="title_action">Conf call with technical service</field>
|
||||
<field name="section_id" ref="crm_case_section_2"/>
|
||||
<field name="user_id" ref="base.user_admin"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="stage_id" ref="crm.stage_lead4"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
|
||||
@@ -38,7 +38,7 @@ class crm_configuration(osv.osv_memory):
|
||||
'module_import_google': fields.boolean("Google (Contacts and Calendar)",
|
||||
help="""Import google contact in partner address and add google calendar events details in Meeting.
|
||||
This installs the module import_google."""),
|
||||
'module_google_map': fields.boolean("add google maps on customer",
|
||||
'module_google_map': fields.boolean("add google maps on customers",
|
||||
help="""Locate customers on Google Map.
|
||||
This installs the module google_map."""),
|
||||
'group_fund_raising': fields.boolean("Manage Fund Raising",
|
||||
|
||||
@@ -23,23 +23,5 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- partner To Opportunity Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_crm_partner2opportunity">
|
||||
<field name="name">Create Opportunity</field>
|
||||
<field name="res_model">crm.partner2opportunity</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form,tree,kanban,calendar</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- partner To Opportunity wizard -->
|
||||
|
||||
<act_window id="crm_partner2opportunity"
|
||||
key2="client_action_multi" name="Create Opportunity"
|
||||
res_model="crm.partner2opportunity" src_model="res.partner"
|
||||
view_id="view_crm_partner2opportunity"
|
||||
view_mode="form" target="new" view_type="form"
|
||||
groups="base.group_sale_salesman"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Norwegian Bokmal translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-04 14:04+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-05 04:46+0000\n"
|
||||
"X-Generator: Launchpad (build 15901)\n"
|
||||
|
||||
#. module: crm_caldav
|
||||
#: model:ir.actions.act_window,name:crm_caldav.action_caldav_browse
|
||||
msgid "Caldav Browse"
|
||||
msgstr "CalDAV Bla"
|
||||
|
||||
#. module: crm_caldav
|
||||
#: model:ir.ui.menu,name:crm_caldav.menu_caldav_browse
|
||||
msgid "Synchronize This Calendar"
|
||||
msgstr "Synkroniser denne kalenderen"
|
||||
|
||||
#. module: crm_caldav
|
||||
#: model:ir.model,name:crm_caldav.model_crm_meeting
|
||||
msgid "Meeting"
|
||||
msgstr "Møte"
|
||||
@@ -12,4 +12,3 @@
|
||||
self.message_update(cr, uid,[ref('crm_claim_4')], {'subject': 'Claim Update record','body': 'first training session completed',})
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
|
||||
name="%(crm_lead_forward_to_partner_act)d"
|
||||
icon="terp-mail-forward" type="action"
|
||||
context="{'mail.compose.message.mode': 'forward', 'default_partner_ids': [partner_assigned_id]}"/>
|
||||
context="{'default_composition_mode': 'forward', 'default_partner_ids': [partner_assigned_id]}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Geo Assignation">
|
||||
|
||||
@@ -36,12 +36,12 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
if context is None:
|
||||
context = {}
|
||||
# set as comment, perform overrided document-like action that calls get_record_data
|
||||
old_mode = context.get('mail.compose.message.mode', 'forward')
|
||||
context['mail.compose.message.mode'] = 'comment'
|
||||
old_mode = context.get('default_composition_mode', 'forward')
|
||||
context['default_composition_mode'] = 'comment'
|
||||
res = super(crm_lead_forward_to_partner, self).default_get(cr, uid, fields, context=context)
|
||||
# back to forward mode
|
||||
context['mail.compose.message.mode'] = old_mode
|
||||
res['composition_mode'] = context['mail.compose.message.mode']
|
||||
context['default_composition_mode'] = old_mode
|
||||
res['composition_mode'] = context['default_composition_mode']
|
||||
return res
|
||||
|
||||
def _get_composition_mode_selection(self, cr, uid, context=None):
|
||||
@@ -89,11 +89,6 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
lead = self.pool.get(model).browse(cr, uid, res_id, context=context)
|
||||
body = self._get_message_body(cr, uid, lead, history_mode, context=context)
|
||||
return {'value': {'body': body}}
|
||||
|
||||
def on_change_partner_ids(self, cr, uid, ids, partner_ids, context=None):
|
||||
""" TDE-TODO: Keep void; maybe we could check that partner_ids have
|
||||
email defined. """
|
||||
return {}
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
""" TDE-HACK: remove 'type' from context, because when viewing an
|
||||
@@ -106,9 +101,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
return new_id
|
||||
|
||||
def action_forward(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Forward the lead to a partner
|
||||
"""
|
||||
""" Forward the lead to a partner """
|
||||
if context is None:
|
||||
context = {}
|
||||
res = {'type': 'ir.actions.act_window_close'}
|
||||
@@ -126,7 +119,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
||||
|
||||
self.send_mail(cr, uid, ids, context=context)
|
||||
# for case in lead.browse(cr, uid, lead_ids, context=context):
|
||||
# TDE: WHAT TO DO WITH THAT ?
|
||||
# TODO: WHAT TO DO WITH THAT ?
|
||||
# if (this.send_to == 'partner' and this.partner_id):
|
||||
# lead.assign_partner(cr, uid, [case.id], this.partner_id.id, context=context)
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
on_change="on_change_history_mode(history_mode, model, res_id)"/>
|
||||
<field name="subject" colspan="4"/>
|
||||
<field name="partner_ids" colspan="4" widget="many2many_tags"
|
||||
on_change="on_change_partner_ids(partner_ids)"/>
|
||||
on_change="onchange_partner_ids(partner_ids)"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Body">
|
||||
<field name="body"/>
|
||||
@@ -51,7 +51,7 @@
|
||||
key2="client_action_multi" name="Mass forward to partner"
|
||||
res_model="crm.lead.forward.to.partner" src_model="crm.lead"
|
||||
view_mode="form" target="new" view_type="form"
|
||||
context="{'mail.compose.message.mode' : 'mass_mail'}"
|
||||
context="{'default_composition_mode' : 'mass_mail'}"
|
||||
view_id="crm_lead_forward_to_partner_form"
|
||||
/>
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# Norwegian Bokmal translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-04 14:07+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Norwegian Bokmal <nb@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-05 04:46+0000\n"
|
||||
"X-Generator: Launchpad (build 15901)\n"
|
||||
|
||||
#. module: crm_todo
|
||||
#: model:ir.model,name:crm_todo.model_project_task
|
||||
msgid "Task"
|
||||
msgstr "Oppgave"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Timebox"
|
||||
msgstr "Timeboks"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "For cancelling the task"
|
||||
msgstr "For å avbryte oppgaven"
|
||||
|
||||
#. module: crm_todo
|
||||
#: constraint:project.task:0
|
||||
msgid "Error ! Task end-date must be greater then task start-date"
|
||||
msgstr "Feil! Oppgave sluttdato må være større enn oppgave startdato"
|
||||
|
||||
#. module: crm_todo
|
||||
#: model:ir.model,name:crm_todo.model_crm_lead
|
||||
msgid "crm.lead"
|
||||
msgstr "crm.lead"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Next"
|
||||
msgstr "Neste"
|
||||
|
||||
#. module: crm_todo
|
||||
#: model:ir.actions.act_window,name:crm_todo.crm_todo_action
|
||||
#: model:ir.ui.menu,name:crm_todo.menu_crm_todo
|
||||
msgid "My Tasks"
|
||||
msgstr "Mine oppgaver"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
#: field:crm.lead,task_ids:0
|
||||
msgid "Tasks"
|
||||
msgstr "Oppgaver"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Done"
|
||||
msgstr "Utført"
|
||||
|
||||
#. module: crm_todo
|
||||
#: constraint:project.task:0
|
||||
msgid "Error ! You cannot create recursive tasks."
|
||||
msgstr "Feil! Du kan ikke lage en rekursive oppgaver."
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Cancel"
|
||||
msgstr "Kanseller"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Extra Info"
|
||||
msgstr "Ekstra informasjon"
|
||||
|
||||
#. module: crm_todo
|
||||
#: field:project.task,lead_id:0
|
||||
msgid "Lead / Opportunity"
|
||||
msgstr "Lede / mulighet"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "For changing to done state"
|
||||
msgstr "For å bytte til ferdig tilstand"
|
||||
|
||||
#. module: crm_todo
|
||||
#: view:crm.lead:0
|
||||
msgid "Previous"
|
||||
msgstr "Tidligere"
|
||||
@@ -1,7 +1,3 @@
|
||||
.oe_form_readonly .oe_notebook {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.oe_document_page ul, .oe_document_page li {
|
||||
padding: 2px 8px;
|
||||
margin: 2px 8px;
|
||||
|
||||
@@ -171,7 +171,7 @@ class email_template(osv.osv):
|
||||
'res_model': 'mail.compose.message',
|
||||
'src_model': src_obj,
|
||||
'view_type': 'form',
|
||||
'context': "{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : %d}" % (template.id),
|
||||
'context': "{'default_composition_mode': 'mass_mail', 'default_template_id' : %d}" % (template.id),
|
||||
'view_mode':'form,tree',
|
||||
'view_id': res_id,
|
||||
'target': 'new',
|
||||
|
||||
@@ -71,23 +71,50 @@ class test_message_compose(common.TransactionCase):
|
||||
_subject1 = 'Pigs'
|
||||
_subject2 = 'Bird'
|
||||
_body_text1 = 'Pigs rules'
|
||||
_body_text_html1 = 'Pigs rules<pre>Admin</pre>'
|
||||
_body_text_html1 = 'Fans of Pigs, unite !\n<pre>Admin</pre>\n'
|
||||
_body_text2 = 'I am angry !'
|
||||
_body_text_html2 = 'I am angry !<pre>Admin</pre>'
|
||||
|
||||
# CASE1: create in mass_mail composition mode that should work with email_template installed
|
||||
# CASE1: create in comment
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': 'Forget me subject', 'body': 'Dummy body'},
|
||||
{'default_composition_mode': 'comment', 'default_model': 'mail.group',
|
||||
'default_res_id': self.group_pigs_id, 'default_use_template': True,
|
||||
'active_ids': [self.group_pigs_id, group_bird_id] })
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
|
||||
# Perform 'onchange_template_id' with 'use_template' set
|
||||
values = mail_compose.onchange_template_id(cr, uid, [], compose.use_template, email_template_id, compose.composition_mode, compose.model, compose.res_id)
|
||||
compose.write(values.get('value', {}), {'default_composition_mode': 'comment', 'default_model': 'mail.group'})
|
||||
compose.refresh()
|
||||
message_pids = [partner.id for partner in compose.partner_ids]
|
||||
partner_ids = self.res_partner.search(cr, uid, [('email', 'in', ['b@b.b', 'c@c.c', 'd@d.d'])])
|
||||
partners = self.res_partner.browse(cr, uid, partner_ids)
|
||||
# Test: subject, body, partner_ids
|
||||
self.assertEqual(compose.subject, _subject1, 'mail.compose.message subject incorrect')
|
||||
self.assertEqual(compose.body, _body_text_html1, 'mail.compose.message body incorrect')
|
||||
self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect')
|
||||
|
||||
# Perform 'onchange_use_template': use_template is not set anymore
|
||||
values = mail_compose.onchange_use_template(cr, uid, [], not compose.use_template, compose.template_id, compose.composition_mode, compose.model, compose.res_id)
|
||||
compose.write(values.get('value', {}), {'default_composition_mode': 'comment', 'default_model': 'mail.group'})
|
||||
compose.refresh()
|
||||
# Test: subject, body, partner_ids
|
||||
self.assertEqual(compose.subject, False, 'mail.compose.message subject incorrect')
|
||||
self.assertEqual(compose.body, '', 'mail.compose.message body incorrect')
|
||||
|
||||
# CASE12 create in mass_mail composition
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': 'Forget me subject', 'body': 'Dummy body'},
|
||||
{'default_composition_mode': 'mass_mail', 'default_model': 'mail.group',
|
||||
'default_res_id': -1, 'default_use_template': True,
|
||||
'active_ids': [self.group_pigs_id, group_bird_id], 'default_template_id': email_template_id})
|
||||
'active_ids': [self.group_pigs_id, group_bird_id] })
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
# print compose.subject
|
||||
|
||||
|
||||
# Try the 'onchange_template_id'
|
||||
values = mail_compose.onchange_template_id(cr, uid, [], compose.use_template, compose.template_id, compose.composition_mode, compose.model, compose.res_id)
|
||||
# Test 'onchange_template_id' with 'use_template' set
|
||||
values = mail_compose.onchange_template_id(cr, uid, [], compose.use_template, email_template_id, compose.composition_mode, compose.model, compose.res_id)
|
||||
print values
|
||||
# self.assertEqual()
|
||||
# compose.write(values['value'])
|
||||
values = mail_compose.onchange_use_template(cr, uid, [], not compose.use_template, compose.template_id, compose.composition_mode, compose.model, compose.res_id)
|
||||
print values
|
||||
|
||||
@@ -28,15 +28,17 @@ from tools.translate import _
|
||||
|
||||
class mail_compose_message(osv.osv_memory):
|
||||
_inherit = 'mail.compose.message'
|
||||
_compose_fields = ['body', 'body_html', 'subject', 'partner_ids', 'attachment_ids']
|
||||
|
||||
def _get_templates(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
model = False
|
||||
email_template_obj= self.pool.get('email.template')
|
||||
message_id = context.get('default_parent_id', context.get('message_id', context.get('active_id')))
|
||||
|
||||
if context.get('default_composition_mode') == 'reply' and context.get('active_id'):
|
||||
message_data = self.pool.get('mail.message').browse(cr, uid, int(context.get('active_id')), context)
|
||||
if context.get('default_composition_mode') == 'reply' and message_id:
|
||||
message_data = self.pool.get('mail.message').browse(cr, uid, message_id, context=context)
|
||||
if message_data:
|
||||
model = message_data.model
|
||||
else:
|
||||
@@ -62,32 +64,17 @@ class mail_compose_message(osv.osv_memory):
|
||||
|
||||
def onchange_template_id(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None):
|
||||
""" - use_template not set: return default_get
|
||||
- use_template set:
|
||||
- mass_mailing: we cannot render, so return the template values
|
||||
- else: return rendered values """
|
||||
fields = ['body', 'body_html', 'subject', 'partner_ids', 'email_to', 'email_cc']
|
||||
- use_template set in mass_mailing: we cannot render, so return the template values
|
||||
- use_template set: return rendered values """
|
||||
if use_template and template_id and composition_mode == 'mass_mail':
|
||||
values = self.pool.get('email.template').read(cr, uid, template_id, fields, context)
|
||||
values = self.pool.get('email.template').read(cr, uid, template_id, self._compose_fields, context)
|
||||
elif use_template and template_id:
|
||||
values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context)
|
||||
|
||||
values['attachment_ids'] = []
|
||||
attachment_obj = self.pool.get('ir.attachment')
|
||||
for attach_fname, attach_datas in values.get('attachments', []):
|
||||
data_attach = {
|
||||
'name': attach_fname,
|
||||
'datas': attach_datas,
|
||||
'datas_fname': attach_fname,
|
||||
'description': fname,
|
||||
'res_model': model,
|
||||
'res_id': res_id,
|
||||
}
|
||||
values['attachment_ids'].append(attachment_obj.create(cr, uid, data_attach), context=context)
|
||||
values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context)
|
||||
else:
|
||||
values = self.default_get(cr, uid, fields, context=context)
|
||||
values = self.default_get(cr, uid, self._compose_fields, context=context)
|
||||
|
||||
if values.get('body_html') and not values.get('body'):
|
||||
values['body'] = values.get('body_html')
|
||||
if values.get('body_html'):
|
||||
values['body'] = values.pop('body_html')
|
||||
values.update(use_template=use_template, template_id=template_id)
|
||||
|
||||
return {'value': values}
|
||||
@@ -98,14 +85,17 @@ class mail_compose_message(osv.osv_memory):
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
onchange_res = self.onchange_use_template(cr, uid, ids, not record.use_template,
|
||||
record.template_id, record.composition_mode, record.model, record.res_id, context=context)['value']
|
||||
record.write(onchange_res)
|
||||
record.write(onchange_res.get('value', {}))
|
||||
return True
|
||||
|
||||
def onchange_use_template(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None):
|
||||
""" onchange_use_template (values: True or False). If use_template is
|
||||
False, we do like an onchange with template_id False for values """
|
||||
return self.onchange_template_id(cr, uid, ids, use_template,
|
||||
values = self.onchange_template_id(cr, uid, ids, use_template,
|
||||
template_id, composition_mode, model, res_id, context=context)
|
||||
if use_template:
|
||||
values['content_subtype'] = 'html'
|
||||
return values
|
||||
|
||||
def save_as_template(self, cr, uid, ids, context=None):
|
||||
""" hit save as template button: current form value will be a new
|
||||
@@ -113,8 +103,7 @@ class mail_compose_message(osv.osv_memory):
|
||||
email_template = self.pool.get('email.template')
|
||||
ir_model_pool = self.pool.get('ir.model')
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
model = record.model
|
||||
model_ids = ir_model_pool.search(cr, uid, [('model', '=', model)])
|
||||
model_ids = ir_model_pool.search(cr, uid, [('model', '=', record.model)], context=context)
|
||||
model_id = model_ids and model_ids[0] or False
|
||||
model_name = ''
|
||||
if model_id:
|
||||
@@ -135,14 +124,49 @@ class mail_compose_message(osv.osv_memory):
|
||||
# Wizard validation and send
|
||||
#------------------------------------------------------
|
||||
|
||||
def generate_email_for_composer(self, cr, uid, template_id, res_id, context=None):
|
||||
""" Call email_template.generate_email(), get fields relevant for
|
||||
mail.compose.message, transform email_cc and email_to into partner_ids """
|
||||
fields = ['body', 'body_html', 'subject', 'email_to', 'email_cc', 'attachment_ids']
|
||||
template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context)
|
||||
values = {field: template_values[field] for field in fields if template_values.get(field)}
|
||||
|
||||
# transform email_to, email_cc into partner_ids
|
||||
values['partner_ids'] = []
|
||||
mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', ''))
|
||||
for mail in mails:
|
||||
partner_search_ids = self.pool.get('res.partner').search(cr, uid, [('email', 'ilike', mail)], context=context)
|
||||
if partner_search_ids:
|
||||
values['partner_ids'].append((4, partner_search_ids[0]))
|
||||
else:
|
||||
partner_id = self.pool.get('res.partner').name_create(cr, uid, mail, context=context)[0]
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
values['partner_ids'].append((4, partner_id))
|
||||
|
||||
# transform attachments into attachment_ids
|
||||
values['attachment_ids'] = []
|
||||
for attach_fname, attach_datas in template_values.get('attachments', []):
|
||||
data_attach = {
|
||||
'name': attach_fname,
|
||||
'datas': attach_datas,
|
||||
'datas_fname': attach_fname,
|
||||
'res_model': model,
|
||||
'res_id': res_id,
|
||||
}
|
||||
values['attachment_ids'].append((0, 0, data_attach))
|
||||
|
||||
return values
|
||||
|
||||
def render_message(self, cr, uid, wizard, model, res_id, context=None):
|
||||
""" Generate an email from the template for given (model, res_id) pair.
|
||||
This method is meant to be inherited by email_template that will
|
||||
produce a more complete dictionary, with email_to, ...
|
||||
"""
|
||||
# render the template to get the email
|
||||
fields = ['body', 'body_html', 'subject', 'email_to', 'email_cc', 'partner_ids', 'attachment_ids']
|
||||
template_values = self.pool.get('email.template').generate_email(cr, uid, wizard.template_id, res_id, context=context)
|
||||
# TDE TODO: handle fields to update / not to update (mail_server_id, auto_delete, ...)
|
||||
template_values = {field: template_values[field] for field in fields if template_values.get(field)}
|
||||
|
||||
# transform email_to, email_cc into partner_ids
|
||||
partner_ids = []
|
||||
mails = tools.email_split(template_values.pop('email_to', '') + ' ' + template_values.pop('email_cc', ''))
|
||||
@@ -154,10 +178,10 @@ class mail_compose_message(osv.osv_memory):
|
||||
partner_id = self.pool.get('res.partner').name_create(cr, uid, mail, context=context)[0]
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
|
||||
partner_ids.append((4, partner_id))
|
||||
|
||||
# get values to return
|
||||
email_dict = super(mail_compose_message, self).render_message(cr, uid, wizard, model, res_id, context)
|
||||
email_dict.update(template_values)
|
||||
email_dict.update(partner_ids=partner_ids, attachments=template_values.get('attachments'))
|
||||
email_dict.update(template_values, partner_ids=partner_ids)
|
||||
return email_dict
|
||||
|
||||
def render_template(self, cr, uid, template, model, res_id, context=None):
|
||||
|
||||
@@ -7,15 +7,12 @@
|
||||
<field name="email_from" >${object.user_id.email or object.company_id.email or 'noreply@' + object.company_id.name + '.com'}</field>
|
||||
<field name="email_to" >${object.email}</field>
|
||||
<field name="subject">Your registration at ${object.event_id.name}</field>
|
||||
<field name="body">
|
||||
hello ${object.name},
|
||||
|
||||
The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}. For any further information please contact our event department.
|
||||
|
||||
we thank you for your participation
|
||||
|
||||
best regards
|
||||
</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Hello ${object.name},</p>
|
||||
<p>The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}.
|
||||
For any further information please contact our event department.</p>
|
||||
<p>Thank you for your participation!</p>
|
||||
<p>Best regards</p>]]></field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
@@ -27,15 +24,12 @@
|
||||
<field name="email_from" >${object.user_id.email or object.company_id.email or 'noreply@' + object.company_id.name + '.com'}</field>
|
||||
<field name="email_to" >${object.email}</field>
|
||||
<field name="subject">Your registration at ${object.event_id.name}</field>
|
||||
<field name="body">
|
||||
hello ${object.name},
|
||||
|
||||
We confirm you that your registration to the event ${object.event_id.name} has been recorded. You will automatically receive an email providing you more practical information (such as the schedule, the plan...) as soon as the event will be confirmed to be held.
|
||||
|
||||
we thank you for your participation
|
||||
|
||||
best regards
|
||||
</field>
|
||||
<field name="body_html"><![CDATA[
|
||||
<p>Hello ${object.name},</p>
|
||||
<p>We confirm that your registration to the event ${object.event_id.name} has been recorded.
|
||||
You will automatically receive an email providing you more practical information (such as the schedule, the agenda...) as soon as the event is confirmed.</p>
|
||||
<p>Thank you for your participation!</p>
|
||||
<p>Best regards</p>]]></field>
|
||||
</record>
|
||||
|
||||
<!-- Default Values -->
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="purchase_ok" position="after">
|
||||
<field name="event_ok" on_change="onchange_event_ok(event_ok, context)"/>
|
||||
<label for="event_ok"/>
|
||||
</field>
|
||||
<field name='procure_method' position='before'>
|
||||
<field name='default_code' position='before'>
|
||||
<field name="event_type_id" attrs="{'readonly': [('event_ok', '=', False)]}"/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
+2
-113
File diff suppressed because one or more lines are too long
@@ -20,7 +20,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Employee" version="7.0">
|
||||
<sheet>
|
||||
<field name="image_small" widget='image' class="oe_right oe_image_small"/>
|
||||
<field name="image_medium" widget='image' class="oe_right oe_avatar"/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
|
||||
@@ -7,14 +7,14 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-08-26 14:02+0000\n"
|
||||
"PO-Revision-Date: 2012-09-03 17:10+0000\n"
|
||||
"Last-Translator: Erwin <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:24+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: hr
|
||||
#: model:process.node,name:hr.process_node_openerpuser0
|
||||
@@ -195,7 +195,7 @@ msgstr "Vrouw"
|
||||
#: help:hr.job,expected_employees:0
|
||||
msgid ""
|
||||
"Expected number of employees for this job position after new recruitment."
|
||||
msgstr ""
|
||||
msgstr "Verwachte aantal werknemers voor deze functie na de nieuwe werving."
|
||||
|
||||
#. module: hr
|
||||
#: model:ir.ui.menu,name:hr.menu_open_view_attendance_reason_new_config
|
||||
@@ -710,12 +710,12 @@ msgstr "Ondergeschikten"
|
||||
#. module: hr
|
||||
#: field:hr.job,no_of_employee:0
|
||||
msgid "Number of employees currently occupying this job position."
|
||||
msgstr ""
|
||||
msgstr "Huidige aantal werknemers welke deze functie bekleden ."
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.job,no_of_recruitment:0
|
||||
msgid "Number of new employees you expect to recruit."
|
||||
msgstr ""
|
||||
msgstr "Verwachte aantal te werven nieuwe werknemers."
|
||||
|
||||
#~ msgid "Sunday"
|
||||
#~ msgstr "Zondag"
|
||||
|
||||
@@ -32,15 +32,15 @@ class hr_config_settings(osv.osv_memory):
|
||||
help ="""This installs the module hr_attendance."""),
|
||||
'module_hr_timesheet': fields.boolean('manage timesheets',
|
||||
help ="""This installs the module hr_timesheet."""),
|
||||
'module_hr_holidays': fields.boolean('manage leaves and allocation requests',
|
||||
'module_hr_holidays': fields.boolean('manage holidays, leaves and allocation requests',
|
||||
help ="""This installs the module hr_holidays."""),
|
||||
'module_hr_expense': fields.boolean('manage employees expenses',
|
||||
help ="""This installs the module hr_expense."""),
|
||||
'module_hr_recruitment': fields.boolean('manage the recruitment pipe',
|
||||
'module_hr_recruitment': fields.boolean('manage the recruitment process',
|
||||
help ="""This installs the module hr_recruitment."""),
|
||||
'module_hr_contract': fields.boolean('manage contract per employee',
|
||||
'module_hr_contract': fields.boolean('record contracts per employee',
|
||||
help ="""This installs the module hr_contract."""),
|
||||
'module_hr_evaluation': fields.boolean('manage employees periodic evaluation',
|
||||
'module_hr_evaluation': fields.boolean('organize employees periodic evaluation',
|
||||
help ="""This installs the module hr_evaluation."""),
|
||||
'module_hr_payroll': fields.boolean('manage payroll',
|
||||
help ="""This installs the module hr_payroll."""),
|
||||
|
||||
@@ -33,6 +33,19 @@
|
||||
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
|
||||
</header>
|
||||
<separator string="Human Resources Management"/>
|
||||
<group name="recruitment_grp">
|
||||
<label for="id" string="Talent Management"/>
|
||||
<div name="recruitment">
|
||||
<div>
|
||||
<field name="module_hr_recruitment" class="oe_inline"/>
|
||||
<label for="module_hr_recruitment"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_hr_evaluation" class="oe_inline"/>
|
||||
<label for="module_hr_evaluation"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<label for="id" string="Additional Features"/>
|
||||
<div>
|
||||
@@ -44,21 +57,6 @@
|
||||
<field name="module_hr_expense" class="oe_inline"/>
|
||||
<label for="module_hr_expense"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_hr_evaluation" class="oe_inline"/>
|
||||
<label for="module_hr_evaluation"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="module_hr_contract" class="oe_inline"/>
|
||||
<label for="module_hr_contract"/>
|
||||
</div>
|
||||
<div name="hr_payroll">
|
||||
<field name="module_hr_payroll" class="oe_inline"/>
|
||||
<label for="module_hr_payroll"/>
|
||||
<button name="%(open_payroll_modules)d" type="action"
|
||||
string="Install your country's payroll" icon="gtk-go-forward"
|
||||
attrs="{'invisible': [('module_hr_payroll','=',False)]}" class="oe_link"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group name="timesheet_grp">
|
||||
@@ -78,12 +76,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group name="recruitment_grp">
|
||||
<label for="id" string="Recruitment"/>
|
||||
<div name="recruitment">
|
||||
<group name="contract_grp">
|
||||
<label for="id" string="Contracts"/>
|
||||
<div>
|
||||
<div>
|
||||
<field name="module_hr_recruitment" class="oe_inline"/>
|
||||
<label for="module_hr_recruitment"/>
|
||||
<field name="module_hr_contract" class="oe_inline"/>
|
||||
<label for="module_hr_contract"/>
|
||||
</div>
|
||||
<div name="hr_payroll">
|
||||
<field name="module_hr_payroll" class="oe_inline"/>
|
||||
<label for="module_hr_payroll"/>
|
||||
<button name="%(open_payroll_modules)d" type="action"
|
||||
string="Install your country's payroll" icon="gtk-go-forward"
|
||||
attrs="{'invisible': [('module_hr_payroll','=',False)]}" class="oe_link"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
@@ -126,9 +126,9 @@
|
||||
<field name="active" position="before">
|
||||
<label for="state"/>
|
||||
<div>
|
||||
<field name="state" class="oe_inline"/>
|
||||
<button class="oe_inline oe_right" name="attendance_action_change" states="present" string="Sign Out" type="object" icon="gtk-go-forward" context="{'type':'sign_out'}" groups="base.group_hr_user"/>
|
||||
<button class="oe_inline oe_right" name="attendance_action_change" states="absent" string="Sign In" type="object" icon="gtk-go-back" context="{'type':'sign_in'}" groups="base.group_hr_user"/>
|
||||
<field name="state" class="oe_inline"/> -
|
||||
<button class="oe_link" name="attendance_action_change" states="present" string="Sign Out" type="object" context="{'type':'sign_out'}" groups="base.group_hr_user"/>
|
||||
<button class="oe_link" name="attendance_action_change" states="absent" string="Sign In" type="object" context="{'type':'sign_in'}" groups="base.group_hr_user"/>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -228,9 +228,13 @@ class hr_evaluation(osv.osv):
|
||||
body = phase.mail_body % {'employee_name': child.name, 'user_signature': child.user_id.signature,
|
||||
'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time }
|
||||
sub = phase.email_subject
|
||||
dest = [child.work_email]
|
||||
if dest:
|
||||
mail_message.schedule_with_attach(cr, uid, evaluation.employee_id.work_email, dest, sub, body, context=context)
|
||||
if child.work_email:
|
||||
vals = {'state': 'outgoing',
|
||||
'subject': sub,
|
||||
'body_html': '<pre>%s</pre>' % body,
|
||||
'email_to': child.work_email,
|
||||
'email_from': evaluation.employee_id.work_email}
|
||||
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'wait'}, context=context)
|
||||
return True
|
||||
|
||||
@@ -267,16 +267,27 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Interview Appraisal" version="7.0">
|
||||
<header>
|
||||
<button string="Cancel" name="survey_req_cancel" states="draft,waiting_answer" type="object" icon="gtk-cancel"/>
|
||||
<button name="action_print_survey" string="Print Survey" type="object" states="draft" icon="gtk-print" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}" attrs="{'readonly':[('survey_id','=',False)]}" class="oe_highlight"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" states="draft" type="object" icon="gtk-yes" class="oe_highlight"/>
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Answer Survey" type="action" states="waiting_answer" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button string="Done" name="survey_req_done" states="waiting_answer" type="object" icon="gtk-jump-to"/>
|
||||
<button string="Cancel" name="survey_req_cancel" type="object"
|
||||
states="draft,waiting_answer"/>
|
||||
<button string="Print Survey" name="action_print_survey" type="object"
|
||||
states="draft" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0}"
|
||||
attrs="{'readonly':[('survey_id','=',False)]}" class="oe_highlight"/>
|
||||
<button string="Send Request" name="survey_req_waiting_answer" type="object"
|
||||
states="draft" class="oe_highlight"/>
|
||||
<button string="Answer Survey" name="%(survey.action_view_survey_question_message)d" type="action"
|
||||
states="waiting_answer"
|
||||
context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}"
|
||||
attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button string="Done" name="survey_req_done" type="object"
|
||||
states="waiting_answer"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="waiting_answer,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box" name="button_box">
|
||||
<button string="Send Reminder Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action" states="waiting_answer"/>
|
||||
<button string="Send Reminder Email" name="%(mail.action_email_compose_message_wizard)d" type="action"
|
||||
states="waiting_answer"
|
||||
context="{'default_body_text': 'Hello,\n\nKindly post your response for the survey interview.\n\nThanks',
|
||||
'default_subject': 'Reminder to fill up Survey' }"/>
|
||||
</div>
|
||||
<group>
|
||||
<group col="3" colspan="1">
|
||||
@@ -389,21 +400,23 @@
|
||||
|
||||
<!-- Email Compose message Action-->
|
||||
<act_window
|
||||
id="evaluation_reminders" name="Appraisal Reminders"
|
||||
res_model="mail.compose.message"
|
||||
src_model="hr.evaluation.interview"
|
||||
view_type="form" view_mode="form"
|
||||
target="new" multi="True"
|
||||
key2="client_action_multi"
|
||||
context="{'mail.compose.message.mode':'mass_mail'}"/>
|
||||
id="evaluation_reminders" name="Appraisal Reminders"
|
||||
res_model="mail.compose.message"
|
||||
src_model="hr.evaluation.interview"
|
||||
view_type="form" view_mode="form"
|
||||
target="new" multi="True"
|
||||
key2="client_action_multi"
|
||||
context="{'default_composition_mode': 'mass_mail',
|
||||
'default_body_text': 'Hello,\n\nKindly post your response for the survey interview.\n\nThanks',
|
||||
'default_subject': 'Reminder to fill up Survey'}"/>
|
||||
|
||||
<!-- Appraisal Interviews Button on Employee Form -->
|
||||
<act_window
|
||||
context="{'search_default_user_to_review_id': [active_id], 'default_user_to_review_id': active_id}"
|
||||
id="act_hr_employee_2_hr__evaluation_interview"
|
||||
name="Appraisal Interviews"
|
||||
res_model="hr.evaluation.interview"
|
||||
src_model="hr.employee"/>
|
||||
context="{'search_default_user_to_review_id': [active_id], 'default_user_to_review_id': active_id}"
|
||||
id="act_hr_employee_2_hr__evaluation_interview"
|
||||
name="Appraisal Interviews"
|
||||
res_model="hr.evaluation.interview"
|
||||
src_model="hr.employee"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -256,6 +256,10 @@ class hr_expense_line(osv.osv):
|
||||
res = dict(cr.fetchall())
|
||||
return res
|
||||
|
||||
def _get_uom_id(self, cr, uid, context=None):
|
||||
result = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_unit')
|
||||
return result and result[1] or False
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Expense Note', size=128, required=True),
|
||||
'date_value': fields.date('Date', required=True),
|
||||
@@ -264,7 +268,7 @@ class hr_expense_line(osv.osv):
|
||||
'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Product Price')),
|
||||
'unit_quantity': fields.float('Quantities', digits_compute= dp.get_precision('Product Unit of Measure')),
|
||||
'product_id': fields.many2one('product.product', 'Product', domain=[('hr_expense_ok','=',True)]),
|
||||
'uom_id': fields.many2one('product.uom', 'Unit of Measure'),
|
||||
'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True),
|
||||
'description': fields.text('Description'),
|
||||
'analytic_account': fields.many2one('account.analytic.account','Analytic account'),
|
||||
'ref': fields.char('Reference', size=32),
|
||||
@@ -273,20 +277,31 @@ class hr_expense_line(osv.osv):
|
||||
_defaults = {
|
||||
'unit_quantity': 1,
|
||||
'date_value': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'uom_id': _get_uom_id,
|
||||
}
|
||||
_order = "sequence, date_value desc"
|
||||
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
|
||||
def onchange_product_id(self, cr, uid, ids, product_id, context=None):
|
||||
res = {}
|
||||
if product_id:
|
||||
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
|
||||
res['name'] = product.name
|
||||
amount_unit = product.price_get('standard_price')[product.id]
|
||||
res['unit_amount'] = amount_unit
|
||||
if not uom_id:
|
||||
res['uom_id'] = product.uom_id.id
|
||||
res['uom_id'] = product.uom_id.id
|
||||
return {'value': res}
|
||||
|
||||
def onchange_uom(self, cr, uid, ids, product_id, uom_id, context=None):
|
||||
res = {'value':{}}
|
||||
if not uom_id or not product_id:
|
||||
return res
|
||||
product = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
|
||||
uom = self.pool.get('product.uom').browse(cr, uid, uom_id, context=context)
|
||||
if uom.category_id.id != product.uom_id.category_id.id:
|
||||
res['warning'] = {'title': _('Warning'), 'message': _('Selected Unit of Measure does not belong to the same category as the product Unit of Measure')}
|
||||
res['value'].update({'uom_id': product.uom_id.id})
|
||||
return res
|
||||
|
||||
hr_expense_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -89,7 +89,7 @@
|
||||
<form string="Expense Lines" version="7.0">
|
||||
<group>
|
||||
<group>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" context="{'default_hr_expense_ok':1}"/>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field domain="[('type','=','normal')]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
|
||||
@@ -99,12 +99,24 @@
|
||||
<label for="unit_quantity"/>
|
||||
<div>
|
||||
<field name="unit_quantity" class="oe_inline"/>
|
||||
<field name="uom_id" on_change="onchange_product_id(product_id, uom_id, parent.employee_id, context)" class="oe_inline"/>
|
||||
<field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="date_value" />
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
<tree string="Expense Lines" editable="bottom">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, context)" context="{'default_hr_expense_ok':1}"/>
|
||||
<field name="date_value" string="Expense Date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field domain="[('type','in',['normal','contract']), ('parent_id','!=',False)]" name="analytic_account" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="uom_id" on_change="onchange_uom(product_id, uom_id, context)"/>
|
||||
<field name="unit_amount"/>
|
||||
<field name="unit_quantity"/>
|
||||
<field name="total_amount" sum="Total"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group>
|
||||
<div>
|
||||
|
||||
@@ -364,7 +364,7 @@ class hr_holidays(osv.osv):
|
||||
def create_notificate(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
self.message_post(cr, uid, ids,
|
||||
_("The request has been <b>created</b> and is waiting confirmation."), context=context)
|
||||
_("The request has been <b>created</b> and is waiting confirmation."),subtype="new", context=context)
|
||||
return True
|
||||
|
||||
def holidays_confirm_notificate(self, cr, uid, ids, context=None):
|
||||
@@ -384,12 +384,12 @@ class hr_holidays(osv.osv):
|
||||
_("The request has been <b>double validated</b>. The validation process is now over."), context=context)
|
||||
else:
|
||||
self.message_post(cr, uid, [obj.id],
|
||||
_("The request has been <b>approved</b>. The validation process is now over."), context=context)
|
||||
_("The request has been <b>approved</b>. The validation process is now over."), subtype="approved", context=context)
|
||||
|
||||
def holidays_refuse_notificate(self, cr, uid, ids, context=None):
|
||||
for obj in self.browse(cr, uid, ids):
|
||||
self.message_post(cr, uid, [obj.id],
|
||||
_("The request has been <b>refused</b>. The validation process is now over."), context=context)
|
||||
_("The request has been <b>refused</b>. The validation process is now over."), subtype="refused", context=context)
|
||||
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
|
||||
@@ -49,5 +49,29 @@ Once validated, they are visible in the employee's calendar. HR officers can def
|
||||
<field name="limit">True</field>
|
||||
<field name="color_name">brown</field>
|
||||
</record>
|
||||
<!--Sub type data -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_approved" model="mail.message.subtype">
|
||||
<field name="name">approved</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -7,14 +7,14 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-02-19 13:05+0000\n"
|
||||
"PO-Revision-Date: 2012-09-03 17:12+0000\n"
|
||||
"Last-Translator: Erwin <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:23+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: hr_holidays
|
||||
#: selection:hr.holidays.status,color_name:0
|
||||
@@ -416,6 +416,8 @@ msgid ""
|
||||
"When selected, the Allocation/Leave Requests for this type require a second "
|
||||
"validation to be approved."
|
||||
msgstr ""
|
||||
"Wanneer aangevinkt heeft deze toewijzing of aanvraag een tweede controle "
|
||||
"nodig om te worden goedgekeurd."
|
||||
|
||||
#. module: hr_holidays
|
||||
#: selection:hr.employee,current_leave_state:0 selection:hr.holidays,state:0
|
||||
@@ -787,6 +789,8 @@ msgid ""
|
||||
"If you select this checkbox, the system allows the employees to take more "
|
||||
"leaves than the available ones for this type."
|
||||
msgstr ""
|
||||
"Indien u deze optie aanvinkt, dan staat u toe dat werknemers meer verlof "
|
||||
"aanvragen dan dat ze nog beschikbaar hebben."
|
||||
|
||||
#. module: hr_holidays
|
||||
#: help:hr.holidays.status,leaves_taken:0
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
date_to: !eval time.strftime('%Y-%m-11 19:00:00')
|
||||
employee_id: hr.employee_fp
|
||||
type: remove
|
||||
-
|
||||
I confirmed the holiday request by clicking on "Confirm" button.
|
||||
-
|
||||
!workflow {model: hr.holidays, action: confirm, ref: hr_holidays_employee1_cl}
|
||||
-
|
||||
I find a small mistake on my leave request to I click on "Refuse" button to correct a mistake.
|
||||
-
|
||||
|
||||
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-01-22 19:09+0000\n"
|
||||
"PO-Revision-Date: 2012-09-03 17:17+0000\n"
|
||||
"Last-Translator: Erwin <Unknown>\n"
|
||||
"Language-Team: Dutch <nl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:33+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: field:hr.payslip.line,condition_select:0
|
||||
@@ -357,7 +357,7 @@ msgstr "Half-jaarlijks"
|
||||
#. module: hr_payroll
|
||||
#: view:hr.salary.rule:0
|
||||
msgid "Children Definition"
|
||||
msgstr ""
|
||||
msgstr "Definitie onderliggende"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: report:paylip.details:0 report:payslip:0
|
||||
@@ -465,7 +465,7 @@ msgstr ""
|
||||
#. module: hr_payroll
|
||||
#: view:hr.payslip:0
|
||||
msgid "Worked Days & Inputs"
|
||||
msgstr ""
|
||||
msgstr "Gewerkte dagen & ingaves"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: field:hr.payslip,details_by_salary_rule_category:0
|
||||
@@ -522,7 +522,7 @@ msgstr "Bereik"
|
||||
#: model:ir.actions.act_window,name:hr_payroll.action_view_hr_payroll_structure_tree
|
||||
#: model:ir.ui.menu,name:hr_payroll.menu_hr_payroll_structure_tree
|
||||
msgid "Salary Structures Hierarchy"
|
||||
msgstr ""
|
||||
msgstr "Salaris structuur hiërarchie"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: view:hr.payslip:0
|
||||
@@ -769,7 +769,7 @@ msgstr "Contributie"
|
||||
#: code:addons/hr_payroll/hr_payroll.py:347
|
||||
#, python-format
|
||||
msgid "Refund Payslip"
|
||||
msgstr ""
|
||||
msgstr "Credit salarisstrook"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: field:hr.rule.input,input_id:0
|
||||
@@ -852,7 +852,7 @@ msgstr "Salaris Structuur"
|
||||
#. module: hr_payroll
|
||||
#: field:hr.contribution.register,register_line_ids:0
|
||||
msgid "Register Line"
|
||||
msgstr ""
|
||||
msgstr "Register regel"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: view:hr.payslip:0 view:hr.payslip.employees:0
|
||||
@@ -1083,7 +1083,7 @@ msgstr "Totaal"
|
||||
#: help:hr.payslip.line,appears_on_payslip:0
|
||||
#: help:hr.salary.rule,appears_on_payslip:0
|
||||
msgid "Used for the display of rule on payslip"
|
||||
msgstr ""
|
||||
msgstr "Wordt gebruikt om de regel van de salaristrook weer te geven"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: view:hr.payslip.line:0
|
||||
@@ -1093,7 +1093,7 @@ msgstr "Zoek loonafschrift regels"
|
||||
#. module: hr_payroll
|
||||
#: view:hr.payslip:0
|
||||
msgid "Details By Salary Rule Category"
|
||||
msgstr ""
|
||||
msgstr "details per salarisregel categorie"
|
||||
|
||||
#. module: hr_payroll
|
||||
#: help:hr.payslip.input,code:0 help:hr.payslip.worked_days,code:0
|
||||
|
||||
@@ -457,14 +457,14 @@ class hr_applicant(base_stage, osv.Model):
|
||||
""" Override of the (void) default notification method. """
|
||||
if not stage_id: return True
|
||||
stage_name = self.pool.get('hr.recruitment.stage').name_get(cr, uid, [stage_id], context=context)[0][1]
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype="stage change", context=context)
|
||||
|
||||
def case_get_note_msg_prefix(self, cr, uid, id, context=None):
|
||||
return 'Applicant'
|
||||
|
||||
def case_open_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Applicant has been set <b>in progress</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="in progress", context=context)
|
||||
|
||||
def case_close_send_note(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
@@ -472,23 +472,23 @@ class hr_applicant(base_stage, osv.Model):
|
||||
for applicant in self.browse(cr, uid, ids, context=context):
|
||||
if applicant.emp_id:
|
||||
message = _("Applicant has been <b>hired</b> and created as an employee.")
|
||||
self.message_post(cr, uid, [applicant.id], body=message, context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype="hired", context=context)
|
||||
else:
|
||||
message = _("Applicant has been <b>hired</b>.")
|
||||
self.message_post(cr, uid, [applicant.id], body=message, context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype="hired", context=context)
|
||||
return True
|
||||
|
||||
def case_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
msg = 'Applicant <b>refused</b>.'
|
||||
return self.message_post(cr, uid, ids, body=msg, context=context)
|
||||
return self.message_post(cr, uid, ids, body=msg, subtype="refused", context=context)
|
||||
|
||||
def case_reset_send_note(self, cr, uid, ids, context=None):
|
||||
message =_("Applicant has been set as <b>new</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
|
||||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Applicant has been <b>created</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
|
||||
|
||||
|
||||
class hr_job(osv.osv):
|
||||
|
||||
@@ -460,6 +460,40 @@ You can automatically receive job application though an email gateway, see the H
|
||||
<field name="alias_model_id" ref="model_hr_applicant"/>
|
||||
<field name="alias_user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--Data for the sub type -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_hired" model="mail.message.subtype">
|
||||
<field name="name">hired</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_in_progress" model="mail.message.subtype">
|
||||
<field name="name">in progress</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -77,7 +77,17 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="act_analytic_cost_revenue">
|
||||
<field name="context">{'search_default_account_id': [active_id], 'default_account_id': active_id, 'search_default_group_date': 1, 'search_default_group_journal': 1}</field>
|
||||
<field name="name">Costs & Revenues</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="src_model">account.analytic.account</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="account_analytic_account_timesheet_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.invoice.form</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
@@ -87,6 +97,12 @@
|
||||
<field name="use_timesheets"/>
|
||||
<label for="use_timesheets"/>
|
||||
</xpath>
|
||||
<xpath expr='//div[@name="buttons"]' position='inside'>
|
||||
<button string="Costs and Revenues"
|
||||
name="%(act_analytic_cost_revenue)d"
|
||||
type="action"/>
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -95,25 +95,25 @@ class account_analytic_account(osv.osv):
|
||||
def set_close(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'close'}, context=context)
|
||||
message = _("Contract has been <b>closed</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||
return True
|
||||
|
||||
def set_cancel(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
|
||||
message = _("Contract has been <b>cancelled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||
return True
|
||||
|
||||
def set_open(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'open'}, context=context)
|
||||
message = _("Contract has been <b>opened</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="open", context=context)
|
||||
return True
|
||||
|
||||
def set_pending(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'pending'}, context=context)
|
||||
message = _("Contract has been set as <b>pending</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype="pending", context=context)
|
||||
return True
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
@@ -16,5 +16,33 @@
|
||||
<field name="customer_name">50%</field>
|
||||
<field name="factor">50.0</field>
|
||||
</record>
|
||||
<!-- Sub Type Data -->
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -122,13 +122,13 @@
|
||||
<field name="search_view_id" ref="account_analytic_line_to_invoice_view_filter"/>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
domain="[('invoice_id','=',False),('to_invoice','<>',False), ('journal_id.type', '=', 'general')]"
|
||||
context="{'search_default_account_id': [active_id], 'default_account_id': active_id,'search_default_to_invoice': 1}"
|
||||
id="act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice"
|
||||
name="Timesheet Lines to Invoice"
|
||||
res_model="account.analytic.line"
|
||||
src_model="account.analytic.account"/>
|
||||
<record id="act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice" model="ir.actions.act_window">
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{'search_default_account_id': [active_id], 'default_account_id': active_id,'search_default_to_invoice': 1}</field>
|
||||
<field name="name">To Invoice</field>
|
||||
<field name="res_model">account.analytic.line</field>
|
||||
<field name="src_model">account.analytic.account</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
- account_id: account.analytic_agrolait
|
||||
date: !eval time.strftime('%Y-%m-%d')
|
||||
name: 'Develop yaml for hr module'
|
||||
user_id: base.user_qdp
|
||||
user_id: base.user_demo
|
||||
unit_amount: 6.00
|
||||
amount: -90.00
|
||||
product_id: product.product_product_consultant
|
||||
@@ -97,7 +97,7 @@
|
||||
date: !eval time.strftime('%Y-%m-%d')
|
||||
name: 'Develop yaml for hr module'
|
||||
unit_amount: 2.00
|
||||
user_id: base.user_qdp
|
||||
user_id: base.user_demo
|
||||
amount: -90.00
|
||||
product_id: product.product_product_consultant
|
||||
general_account_id: account.a_expense
|
||||
|
||||
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-05-24 17:37+0000\n"
|
||||
"Last-Translator: Numérigraphe <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-09-03 22:20+0000\n"
|
||||
"Last-Translator: Nicolas JEUDY <njeudy@simplee.fr>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:42+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: code:addons/import_sugarcrm/import_sugarcrm.py:1105
|
||||
@@ -38,7 +38,7 @@ msgstr "(Prochainement)"
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,document:0
|
||||
msgid "Documents"
|
||||
msgstr ""
|
||||
msgstr "Documents"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
@@ -58,7 +58,7 @@ msgstr ""
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,contact:0
|
||||
msgid "Contacts"
|
||||
msgstr ""
|
||||
msgstr "Contacts"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
@@ -79,7 +79,7 @@ msgstr "Nom de l'instance"
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,project_task:0
|
||||
msgid "Project Tasks"
|
||||
msgstr ""
|
||||
msgstr "Tâches du projet"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,email_from:0
|
||||
@@ -134,27 +134,27 @@ msgstr ""
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,employee:0
|
||||
msgid "Employee"
|
||||
msgstr ""
|
||||
msgstr "Employé"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
msgid "Document"
|
||||
msgstr ""
|
||||
msgstr "Document"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: help:import.sugarcrm,document:0
|
||||
msgid "Check this box to import sugarCRM Documents into OpenERP documents"
|
||||
msgstr ""
|
||||
msgstr "Cochez cette case pour importer les documents SugarCRM dans OpenERP"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
msgid "Import Data From SugarCRM"
|
||||
msgstr ""
|
||||
msgstr "Importee les données de SugarCRM"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
msgid "CRM"
|
||||
msgstr ""
|
||||
msgstr "CRM"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.message:0
|
||||
@@ -166,7 +166,7 @@ msgstr ""
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,call:0
|
||||
msgid "Calls"
|
||||
msgstr ""
|
||||
msgstr "Appels"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
@@ -176,7 +176,7 @@ msgstr ""
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.message:0
|
||||
msgid "_Ok"
|
||||
msgstr ""
|
||||
msgstr "_Valider"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: help:import.sugarcrm,opportunity:0
|
||||
@@ -184,11 +184,13 @@ msgid ""
|
||||
"Check this box to import sugarCRM Leads and Opportunities into OpenERP Leads "
|
||||
"and Opportunities"
|
||||
msgstr ""
|
||||
"Cochez cette case pour importer les Pistes et les Opportunités SugarCRM dans "
|
||||
"OpenERP."
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,email_history:0
|
||||
msgid "Email and Note"
|
||||
msgstr ""
|
||||
msgstr "Email et note"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: help:import.sugarcrm,url:0
|
||||
@@ -208,12 +210,12 @@ msgstr ""
|
||||
#. module: import_sugarcrm
|
||||
#: view:import.sugarcrm:0
|
||||
msgid "_Import"
|
||||
msgstr ""
|
||||
msgstr "_Importer"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: field:import.sugarcrm,user:0
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
msgstr "Utilisateur"
|
||||
|
||||
#. module: import_sugarcrm
|
||||
#: code:addons/import_sugarcrm/import_sugarcrm.py:1105
|
||||
|
||||
@@ -8,14 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-09 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-05-10 17:39+0000\n"
|
||||
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-09-03 17:14+0000\n"
|
||||
"Last-Translator: Erwin <Unknown>\n"
|
||||
"Language-Team: Dutch <nl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:40+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: mail
|
||||
#: field:mail.compose.message,subtype:0 field:mail.message,subtype:0
|
||||
@@ -196,7 +196,7 @@ msgstr "Ontvangers"
|
||||
#. module: mail
|
||||
#: model:ir.model,name:mail.model_mail_compose_message
|
||||
msgid "Email composition wizard"
|
||||
msgstr ""
|
||||
msgstr "E-mail samenstellen wizard"
|
||||
|
||||
#. module: mail
|
||||
#: field:mail.compose.message,res_id:0 field:mail.message,res_id:0
|
||||
|
||||
+18
-12
@@ -28,12 +28,8 @@ from osv import fields
|
||||
from tools.translate import _
|
||||
|
||||
class mail_group(osv.Model):
|
||||
"""
|
||||
A mail_group is a collection of users sharing messages in a discussion
|
||||
group. Group users are users that follow the mail group, using the
|
||||
subscription/follow mechanism of OpenSocial. A mail group has nothing
|
||||
in common with res.users.group.
|
||||
"""
|
||||
""" A mail_group is a collection of users sharing messages in a discussion
|
||||
group. The group mechanics are based on the followers. """
|
||||
_description = 'Discussion group'
|
||||
_name = 'mail.group'
|
||||
_inherit = ['mail.thread']
|
||||
@@ -48,10 +44,6 @@ class mail_group(osv.Model):
|
||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
||||
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
|
||||
|
||||
def _get_default_image(self, cr, uid, context=None):
|
||||
image_path = openerp.modules.get_module_resource('mail', 'static/src/img', 'groupdefault.png')
|
||||
return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
|
||||
|
||||
_columns = {
|
||||
'description': fields.text('Description'),
|
||||
'menu_id': fields.many2one('ir.ui.menu', string='Related Menu', required=True, ondelete="cascade"),
|
||||
@@ -93,6 +85,10 @@ class mail_group(osv.Model):
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'group_user')
|
||||
return ref and ref[1] or False
|
||||
|
||||
def _get_default_image(self, cr, uid, context=None):
|
||||
image_path = openerp.modules.get_module_resource('mail', 'static/src/img', 'groupdefault.png')
|
||||
return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
|
||||
|
||||
def _get_menu_parent(self, cr, uid, context=None):
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', 'mail_group_root')
|
||||
return ref and ref[1] or False
|
||||
@@ -131,9 +127,10 @@ class mail_group(osv.Model):
|
||||
search_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', 'view_message_search')
|
||||
params = {
|
||||
'search_view_id': search_ref and search_ref[1] or False,
|
||||
'domain': [('model','=','mail.group'),('res_id','=',mail_group_id)],
|
||||
'domain': [('model','=','mail.group'), ('res_id','=',mail_group_id)],
|
||||
'context': {'default_model': 'mail.group', 'default_res_id': mail_group_id},
|
||||
'res_model': 'mail.message',
|
||||
'thread_level': 2
|
||||
'thread_level': 1,
|
||||
}
|
||||
cobj = self.pool.get('ir.actions.client')
|
||||
newref = cobj.copy(cr, uid, ref[1], default={'params': str(params), 'name': vals['name']}, context=context)
|
||||
@@ -159,3 +156,12 @@ class mail_group(osv.Model):
|
||||
self._subscribe_users(cr, uid, ids, vals.get('group_ids'), context=context)
|
||||
return result
|
||||
|
||||
def action_follow(self, cr, uid, ids, context=None):
|
||||
""" Wrapper because message_subscribe_users take a user_ids=None
|
||||
that receive the context without the wrapper. """
|
||||
return self.message_subscribe_users(cr, uid, ids, context=context)
|
||||
|
||||
def action_unfollow(self, cr, uid, ids, context=None):
|
||||
""" Wrapper because message_unsubscribe_users take a user_ids=None
|
||||
that receive the context without the wrapper. """
|
||||
return self.message_unsubscribe_users(cr, uid, ids, context=context)
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<h4><a type="open"><field name="name"/></a></h4>
|
||||
<ul>
|
||||
<li><t t-raw="record.message_summary.raw_value"/></li>
|
||||
<li t-if="! record.message_is_follower.raw_value"><a name="message_subscribe_users" string="Join" type="object" class="oe_group_join">Not following</a></li>
|
||||
<li t-if="record.message_is_follower.raw_value"><a name="message_unsubscribe_users" string="Leave" type="object" class="oe_group_leave">Following</a></li>
|
||||
<li t-if="! record.message_is_follower.raw_value"><a name="action_follow" string="Join" type="object" class="oe_group_join">Not following</a></li>
|
||||
<li t-if="record.message_is_follower.raw_value"><a name="action_unfollow" string="Leave" type="object" class="oe_group_leave">Following</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,11 +56,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Group Form" version="7.0">
|
||||
<sheet class="openerp_mail_group_sheet">
|
||||
<field name="image_small" widget='image' class="oe_avatar oe_left"/>
|
||||
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name" string="Group Name"/>
|
||||
</div>
|
||||
<label for="name" string="Group Name"/>
|
||||
</div>
|
||||
<h1><field name="name"/></h1>
|
||||
<div name="alias_box" colspan="4" attrs="{'invisible': [('alias_domain', '=', False)]}">
|
||||
<field name="alias_id" invisible="1" required="0"/>
|
||||
@@ -81,7 +81,6 @@
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_is_follower" invisible="1"/>
|
||||
<field name="message_ids" widget="mail_thread"
|
||||
options='{"thread_level": 1}'/>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
@@ -116,7 +115,7 @@
|
||||
|
||||
<!-- group record !-->
|
||||
<record id="action_view_groups" model="ir.actions.act_window">
|
||||
<field name="name">Groups</field>
|
||||
<field name="name">Join a group</field>
|
||||
<field name="res_model">mail.group</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
@@ -125,6 +124,6 @@
|
||||
|
||||
<!-- left-side menu: Groups !-->
|
||||
<menuitem id="mail_group_root" parent="mail_feeds_main" sequence="12" name="My Groups"/>
|
||||
<menuitem id="mail_allgroups" parent="mail_feeds" sequence="12" action="action_view_groups"/>
|
||||
<menuitem id="mail_allgroups" parent="mail_group_root" sequence="100" action="action_view_groups"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div>
|
||||
by <field name="author_id" class="oe_inline" string="User"/> on <field name="date" class="oe_inline"/>
|
||||
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
|
||||
context="{'mail.compose.message.mode':'reply', 'message_id':active_id}" states='received,sent,exception,cancel'/>
|
||||
context="{'default_composition_mode':'reply', 'default_parent_id': active_id}" states='received,sent,exception,cancel'/>
|
||||
</div>
|
||||
<notebook colspan="4">
|
||||
<page string="Message Details">
|
||||
|
||||
@@ -136,7 +136,8 @@ class mail_message(osv.Model):
|
||||
_defaults = {
|
||||
'type': 'email',
|
||||
'date': lambda *a: fields.datetime.now(),
|
||||
'author_id': _get_default_author
|
||||
'author_id': lambda self,cr,uid,ctx: self._get_default_author(cr, uid, ctx),
|
||||
'body': '',
|
||||
}
|
||||
|
||||
#------------------------------------------------------
|
||||
|
||||
@@ -28,8 +28,7 @@ class mail_message_subtype(osv.osv):
|
||||
_description = 'mail_message_subtype'
|
||||
_columns = {
|
||||
'name': fields.char(' Message Subtype ', size = 128,
|
||||
required = True, select = 1,
|
||||
help = 'Subtype Of Message'),
|
||||
required = True, help = 'Subtype Of Message'),
|
||||
'model_ids': fields.many2many('ir.model',
|
||||
'mail_message_subtyp_message_rel',
|
||||
'message_subtype_id', 'model_id', 'Model',
|
||||
|
||||
@@ -90,13 +90,15 @@
|
||||
<record id="action_mail_all_feeds" model="ir.actions.client">
|
||||
<field name="name">News Feed</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid])] }""/>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_my_feeds" model="ir.actions.client">
|
||||
<field name="name">My Feeds</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('author_id.user_ids', 'in', [uid])]}""/>
|
||||
<field name="params" eval=""{'domain': [('author_id.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid} }""/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+60
-67
@@ -29,7 +29,6 @@ import time
|
||||
import tools
|
||||
import xmlrpclib
|
||||
|
||||
from email.utils import parsedate
|
||||
from email.message import Message
|
||||
from mail_message import decode
|
||||
from osv import osv, fields
|
||||
@@ -42,24 +41,20 @@ def decode_header(message, header, separator=' '):
|
||||
return separator.join(map(decode,message.get_all(header, [])))
|
||||
|
||||
class many2many_reference(fields.many2many):
|
||||
""" many2many_reference is an override of fields.many2many. It manages
|
||||
many2many-like table where one id is given by two fields, res_model
|
||||
and res_id.
|
||||
"""
|
||||
""" many2many_reference manages many2many fields where one id is found
|
||||
by a reference-like key (a char column in addition to the foreign id).
|
||||
The reference_column attribute on the many2many fields is used;
|
||||
if not defined, ``res_model`` is used. """
|
||||
|
||||
def _get_query_and_where_params(self, cr, model, ids, values, where_params):
|
||||
""" Add in where:
|
||||
- ``mail_followers``.res_model = 'crm.lead'
|
||||
"""
|
||||
# reference column name: given by attribute or res_model
|
||||
ref_col_name = self.ref_col_name if self.ref_col_name else 'res_model'
|
||||
values.update({'ref_col_name': ref_col_name, 'ref_col_value': model._name})
|
||||
|
||||
""" Add in where condition like mail_followers.res_model = 'crm.lead' """
|
||||
reference_column = self.reference_column if self.reference_column else 'res_model'
|
||||
values.update(reference_column=reference_column, reference_value=model._name)
|
||||
query = 'SELECT %(rel)s.%(id2)s, %(rel)s.%(id1)s \
|
||||
FROM %(rel)s, %(from_c)s \
|
||||
WHERE %(rel)s.%(id1)s IN %%s \
|
||||
AND %(rel)s.%(id2)s = %(tbl)s.id \
|
||||
AND %(rel)s.%(ref_col_name)s = \'%(ref_col_value)s\' \
|
||||
AND %(rel)s.%(reference_column)s = \'%(reference_value)s\' \
|
||||
%(where_c)s \
|
||||
%(order_by)s \
|
||||
%(limit)s \
|
||||
@@ -68,41 +63,41 @@ class many2many_reference(fields.many2many):
|
||||
return query, where_params
|
||||
|
||||
def set(self, cr, model, id, name, values, user=None, context=None):
|
||||
""" Override to add the res_model field in queries. """
|
||||
""" Override to add the reference field in queries. """
|
||||
if not values: return
|
||||
rel, id1, id2 = self._sql_names(model)
|
||||
obj = model.pool.get(self._obj)
|
||||
# reference column name: given by attribute or res_model
|
||||
ref_col_name = self.ref_col_name if self.ref_col_name else 'res_model'
|
||||
reference_column = self.reference_column if self.reference_column else 'res_model'
|
||||
for act in values:
|
||||
if not (isinstance(act, list) or isinstance(act, tuple)) or not act:
|
||||
continue
|
||||
if act[0] == 0:
|
||||
idnew = obj.create(cr, user, act[2], context=context)
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+ref_col_name+') VALUES (%s,%s,%s)', (id, idnew, model._name))
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+reference_column+') VALUES (%s,%s,%s)', (id, idnew, model._name))
|
||||
elif act[0] == 3:
|
||||
cr.execute('DELETE FROM '+rel+' WHERE '+id1+'=%s AND '+id2+'=%s AND '+ref_col_name+'=%s', (id, act[1], model._name))
|
||||
cr.execute('DELETE FROM '+rel+' WHERE '+id1+'=%s AND '+id2+'=%s AND '+reference_column+'=%s', (id, act[1], model._name))
|
||||
elif act[0] == 4:
|
||||
# following queries are in the same transaction - so should be relatively safe
|
||||
cr.execute('SELECT 1 FROM '+rel+' WHERE '+id1+'=%s AND '+id2+'=%s AND '+ref_col_name+'=%s', (id, act[1], model._name))
|
||||
cr.execute('SELECT 1 FROM '+rel+' WHERE '+id1+'=%s AND '+id2+'=%s AND '+reference_column+'=%s', (id, act[1], model._name))
|
||||
if not cr.fetchone():
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+ref_col_name+') VALUES (%s,%s,%s)', (id, act[1], model._name))
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+reference_column+') VALUES (%s,%s,%s)', (id, act[1], model._name))
|
||||
elif act[0] == 5:
|
||||
cr.execute('delete from '+rel+' where '+id1+' = %s AND '+ref_col_name+'=%s', (id, model._name))
|
||||
cr.execute('delete from '+rel+' where '+id1+' = %s AND '+reference_column+'=%s', (id, model._name))
|
||||
elif act[0] == 6:
|
||||
d1, d2,tables = obj.pool.get('ir.rule').domain_get(cr, user, obj._name, context=context)
|
||||
if d1:
|
||||
d1 = ' and ' + ' and '.join(d1)
|
||||
else:
|
||||
d1 = ''
|
||||
cr.execute('DELETE FROM '+rel+' WHERE '+id1+'=%s AND '+ref_col_name+'=%s AND '+id2+' IN (SELECT '+rel+'.'+id2+' FROM '+rel+', '+','.join(tables)+' WHERE '+rel+'.'+id1+'=%s AND '+rel+'.'+id2+' = '+obj._table+'.id '+ d1 +')', [id, model._name, id]+d2)
|
||||
cr.execute('DELETE FROM '+rel+' WHERE '+id1+'=%s AND '+reference_column+'=%s AND '+id2+' IN (SELECT '+rel+'.'+id2+' FROM '+rel+', '+','.join(tables)+' WHERE '+rel+'.'+id1+'=%s AND '+rel+'.'+id2+' = '+obj._table+'.id '+ d1 +')', [id, model._name, id]+d2)
|
||||
for act_nbr in act[2]:
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+ref_col_name+') VALUES (%s,%s,%s)', (id, act_nbr, model._name))
|
||||
cr.execute('INSERT INTO '+rel+' ('+id1+','+id2+','+reference_column+') VALUES (%s,%s,%s)', (id, act_nbr, model._name))
|
||||
# cases 1, 2: performs write and unlink -> default implementation is ok
|
||||
else:
|
||||
return super(many2many_reference, self).set(cr, model, id, name, values, user, context)
|
||||
|
||||
class mail_thread(osv.Model):
|
||||
class mail_thread(osv.AbstractModel):
|
||||
''' mail_thread model is meant to be inherited by any model that needs to
|
||||
act as a discussion topic on which messages can be attached. Public
|
||||
methods are prefixed with ``message_`` in order to avoid name
|
||||
@@ -161,19 +156,18 @@ class mail_thread(osv.Model):
|
||||
type='boolean', string='Is a Follower', multi='_get_message_data'),
|
||||
'message_follower_ids': many2many_reference('res.partner',
|
||||
'mail_followers', 'res_id', 'partner_id',
|
||||
ref_col_name='res_model', string='Followers'),
|
||||
reference_column='res_model', string='Followers'),
|
||||
'message_comment_ids': fields.one2many('mail.message', 'res_id',
|
||||
domain=lambda self: [('model','=',self._name),('type','in',('comment','email'))],
|
||||
string='Related Messages',
|
||||
help="All messages related to the current document."),
|
||||
domain=lambda self: [('model', '=', self._name), ('type', 'in', ('comment', 'email'))],
|
||||
string='Comments and emails',
|
||||
help="Comments and emails"),
|
||||
'message_ids': fields.one2many('mail.message', 'res_id',
|
||||
domain=lambda self: [('model','=',self._name)],
|
||||
string='Related Messages',
|
||||
help="All messages related to the current document."),
|
||||
string='Messages',
|
||||
help="Messages and communication history"),
|
||||
'message_unread': fields.function(_get_message_data, fnct_search=_search_unread,
|
||||
string='Has Unread Messages', type='boolean',
|
||||
help="When checked, new messages require your attention.",
|
||||
multi="_get_message_data"),
|
||||
type='boolean', string='Unread Messages', multi="_get_message_data",
|
||||
help="If checked new messages require your attention."),
|
||||
'message_summary': fields.function(_get_message_data, method=True,
|
||||
type='text', string='Summary', multi="_get_message_data",
|
||||
help="Holds the Chatter summary (number of messages, ...). "\
|
||||
@@ -186,7 +180,7 @@ class mail_thread(osv.Model):
|
||||
#------------------------------------------------------
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
""" Override of create to subscribe the current user. """
|
||||
""" Override to subscribe the current user. """
|
||||
thread_id = super(mail_thread, self).create(cr, uid, vals, context=context)
|
||||
self.message_subscribe_users(cr, uid, [thread_id], [uid], context=context)
|
||||
return thread_id
|
||||
@@ -217,14 +211,20 @@ class mail_thread(osv.Model):
|
||||
# Mail gateway
|
||||
#------------------------------------------------------
|
||||
|
||||
def message_capable_models(self, cr, uid, context=None):
|
||||
""" Used by the plugin addon, based for plugin_outlook and others. """
|
||||
ret_dict = {}
|
||||
for model_name in self.pool.obj_list():
|
||||
model = self.pool.get(model_name)
|
||||
if 'mail.thread' in getattr(model, '_inherit', []):
|
||||
ret_dict[model_name] = model._description
|
||||
return ret_dict
|
||||
|
||||
def _message_find_partners(self, cr, uid, message, header_fields=['From'], context=None):
|
||||
""" Find partners related to some header fields of the message. """
|
||||
s = ', '.join([decode(message.get(h)) for h in header_fields if message.get(h)])
|
||||
mails = tools.email_split(s)
|
||||
result = []
|
||||
for email in mails:
|
||||
result += self.pool.get('res.partner').search(cr, uid, [('email', 'ilike', email)], context=context)
|
||||
return result
|
||||
return [partner_id for email in tools.email_split(s)
|
||||
for partner_id in self.pool.get('res.partner').search(cr, uid, [('email', 'ilike', email)], context=context)]
|
||||
|
||||
def _message_find_user_id(self, cr, uid, message, context=None):
|
||||
from_local_part = tools.email_split(decode(message.get('From')))[0]
|
||||
@@ -387,9 +387,7 @@ class mail_thread(osv.Model):
|
||||
for a given thread model, if the message did not belong to
|
||||
an existing thread.
|
||||
The default behavior is to create a new record of the corresponding
|
||||
model (based on some very basic info extracted from the message),
|
||||
then attach the message to the newly created record
|
||||
(by calling ``message_append_dict``).
|
||||
model (based on some very basic info extracted from the message).
|
||||
Additional behavior may be implemented by overriding this method.
|
||||
|
||||
:param dict msg_dict: a map containing the email details and
|
||||
@@ -422,9 +420,8 @@ class mail_thread(osv.Model):
|
||||
|
||||
def message_update(self, cr, uid, ids, msg_dict, update_vals=None, context=None):
|
||||
"""Called by ``message_process`` when a new message is received
|
||||
for an existing thread. The default behavior is to create a
|
||||
new mail.message in the given thread (by calling
|
||||
``message_append_dict``)
|
||||
for an existing thread. The default behavior is to update the record
|
||||
with update_vals taken from the incoming email.
|
||||
Additional behavior may be implemented by overriding this
|
||||
method.
|
||||
:param dict msg_dict: a map containing the email details and
|
||||
@@ -556,23 +553,23 @@ class mail_thread(osv.Model):
|
||||
#------------------------------------------------------
|
||||
|
||||
def log(self, cr, uid, id, message, secondary=False, context=None):
|
||||
_logger.warning("log() is deprecated. As this module inherit from \
|
||||
mail.thread, the message will be managed by this \
|
||||
module instead of by the res.log mechanism. Please \
|
||||
use the mail.thread OpenChatter API instead of the \
|
||||
now deprecated res.log.")
|
||||
_logger.warning("log() is deprecated. As this module inherit from "\
|
||||
"mail.thread, the message will be managed by this "\
|
||||
"module instead of by the res.log mechanism. Please "\
|
||||
"use mail_thread.message_post() instead of the "\
|
||||
"now deprecated res.log.")
|
||||
self.message_post(cr, uid, [id], message, context=context)
|
||||
|
||||
def message_post(self, cr, uid, thread_id, body='', subject=False,
|
||||
msg_type='notification', parent_id=False, attachments=None, subtype='other', context=None, **kwargs):
|
||||
""" Post a new message in an existing message thread, returning the new
|
||||
type='notification', parent_id=False, attachments=None, subtype='other', context=None, **kwargs):
|
||||
""" Post a new message in an existing thread, returning the new
|
||||
mail.message ID. Extra keyword arguments will be used as default
|
||||
column values for the new mail.message record.
|
||||
:param int thread_id: thread ID to post into, or list with one ID
|
||||
:param str body: body of the message, usually raw HTML that will
|
||||
be sanitized
|
||||
:param str subject: optional subject
|
||||
:param str msg_type: mail_message.type
|
||||
:param str type: mail_message.type
|
||||
:param int parent_id: optional ID of parent message in this thread
|
||||
:param tuple(str,str) attachments: list of attachment tuples in the form
|
||||
``(name,content)``, where content is NOT base64 encoded
|
||||
@@ -608,11 +605,11 @@ class mail_thread(osv.Model):
|
||||
if self._name in [model.model for model in subtype_browse.model_ids]:
|
||||
values['subtype_id']=subtype_browse.id
|
||||
values.update( {
|
||||
'model': thread_id and context.get('thread_model', self._name) or False,
|
||||
'model': context.get('thread_model', self._name) if thread_id else False,
|
||||
'res_id': thread_id or False,
|
||||
'body': body,
|
||||
'subject': subject,
|
||||
'type': msg_type,
|
||||
'type': type,
|
||||
'parent_id': parent_id,
|
||||
'attachment_ids': attachment_ids,
|
||||
})
|
||||
@@ -626,16 +623,14 @@ class mail_thread(osv.Model):
|
||||
def message_subscribe_users(self, cr, uid, ids, user_ids=None, context=None):
|
||||
""" Wrapper on message_subscribe, using users. If user_ids is not
|
||||
provided, subscribe uid instead. """
|
||||
# isinstance: because using message_subscribe_users called in a view set the context as user_ids
|
||||
if not user_ids or isinstance(user_ids, dict): user_ids = [uid]
|
||||
if not user_ids: user_ids = [uid]
|
||||
partner_ids = [user.partner_id.id for user in self.pool.get('res.users').browse(cr, uid, user_ids, context=context)]
|
||||
return self.message_subscribe(cr, uid, ids, partner_ids, context=context)
|
||||
|
||||
def message_subscribe(self, cr, uid, ids, partner_ids,subtype_ids = None, context=None):
|
||||
""" Add partners to the records followers.
|
||||
|
||||
:param partner_ids: a list of partner_ids to subscribe
|
||||
:param return: new value of followers, for Chatter
|
||||
:param return: new value of followers if read_back key in context
|
||||
"""
|
||||
self.write(cr, uid, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context)
|
||||
if not subtype_ids:
|
||||
@@ -643,29 +638,27 @@ class mail_thread(osv.Model):
|
||||
subtype_ids = subtype_obj.search(cr, uid, [('default', '=', 'true'),('model_ids.model', '=', self._name)])
|
||||
if subtype_ids:
|
||||
self.message_subscribe_udpate_subtypes(cr, uid, ids, partner_ids, subtype_ids, context=context)
|
||||
|
||||
# TDE: temp, must check followers widget
|
||||
if context and context.get('read_back'):
|
||||
return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
|
||||
return []
|
||||
# return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
|
||||
|
||||
|
||||
def message_unsubscribe_users(self, cr, uid, ids, user_ids=None, context=None):
|
||||
""" Wrapper on message_subscribe, using users. If user_ids is not
|
||||
provided, unsubscribe uid instead. """
|
||||
# isinstance: because using message_subscribe_users called in a view set the context as user_ids
|
||||
if not user_ids or isinstance(user_ids, dict): user_ids = [uid]
|
||||
if not user_ids: user_ids = [uid]
|
||||
partner_ids = [user.partner_id.id for user in self.pool.get('res.users').browse(cr, uid, user_ids, context=context)]
|
||||
return self.message_unsubscribe(cr, uid, ids, partner_ids, context=context)
|
||||
|
||||
def message_unsubscribe(self, cr, uid, ids, partner_ids, context=None):
|
||||
""" Remove partners from the records followers.
|
||||
|
||||
:param partner_ids: a list of partner_ids to unsubscribe
|
||||
:param return: new value of followers, for Chatter
|
||||
:param return: new value of followers if read_back key in context
|
||||
"""
|
||||
self.write(cr, uid, ids, {'message_follower_ids': [(3, pid) for pid in partner_ids]}, context=context)
|
||||
# TDE: temp, must check followers widget
|
||||
if context and context.get('read_back'):
|
||||
return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
|
||||
return []
|
||||
# return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
|
||||
|
||||
#------------------------------------------------------
|
||||
# Thread state
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data>
|
||||
|
||||
<!-- Top menu item -->
|
||||
<menuitem name="Feeds"
|
||||
<menuitem name="Home"
|
||||
id="mail_feeds_main"
|
||||
groups="base.group_user"
|
||||
sequence="10"/>
|
||||
@@ -11,8 +11,18 @@
|
||||
<!-- Left-side menu: Feeds -->
|
||||
<menuitem id="mail_feeds" name="Feeds" parent="mail_feeds_main" groups="base.group_user" sequence="10"/>
|
||||
|
||||
<menuitem id="mail_wallfeeds" name="News Feed" parent="mail_feeds" action="action_mail_all_feeds" sequence="10"/>
|
||||
<menuitem id="mail_myfeeds" name="My Feeds" parent="mail_feeds" action="action_mail_my_feeds" sequence="11"/>
|
||||
<record id="mail_wallfeeds" model="ir.ui.menu">
|
||||
<field name="name">My Feeds</field>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="action" ref="action_mail_all_feeds"/>
|
||||
<field name="parent_id" ref="mail_feeds"/>
|
||||
</record>
|
||||
<record id="mail_myfeeds" model="ir.ui.menu">
|
||||
<field name="name">My Posts</field>
|
||||
<field name="sequence" eval="11"/>
|
||||
<field name="action" ref="action_mail_my_feeds"/>
|
||||
<field name="parent_id" ref="mail_feeds"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -96,6 +96,10 @@ class res_users(osv.Model):
|
||||
alias_pool.unlink(cr, uid, alias_ids, context=context)
|
||||
return res
|
||||
|
||||
def message_post(self, cr, uid, thread_id, **kwargs):
|
||||
partner_id = self.pool.get('res.users').browse(cr, uid, thread_id)[0].partner_id.id
|
||||
return self.pool.get('res.partner').message_post(cr, uid, partner_id, **kwargs)
|
||||
|
||||
class res_users_mail_group(osv.Model):
|
||||
""" Update of res.users class
|
||||
- if adding groups to an user, check mail.groups linked to this user
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_recthread ul, .openerp .oe_mail_recthread li {
|
||||
.openerp .oe_chatter ul, .openerp .oe_chatter li {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
@@ -78,10 +78,6 @@
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_recthread {
|
||||
/*overflow: auto;*/
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_recthread_main {
|
||||
float: left;
|
||||
width: 560px;
|
||||
|
||||
+121
-169
@@ -17,9 +17,15 @@ openerp.mail = function(session) {
|
||||
*/
|
||||
|
||||
session.web.FormView = session.web.FormView.extend({
|
||||
// #FIXME TODO: CHECK WITH NEW BRANCH
|
||||
// TDE FIXME TODO: CHECK WITH NEW BRANCH
|
||||
do_action: function(action, on_close) {
|
||||
if (action.res_model == 'mail.compose.message' && this.fields && this.fields.message_ids && this.fields.message_ids.view.get("actual_mode") != 'create') {
|
||||
if (action.res_model == 'mail.compose.message' &&
|
||||
this.fields && this.fields.message_ids &&
|
||||
this.fields.message_ids.view.get("actual_mode") != 'create') {
|
||||
// debug
|
||||
console.groupCollapsed('FormView do_action on mail.compose.message');
|
||||
console.log('message_ids field:', this.fields.message_ids);
|
||||
console.groupEnd();
|
||||
var record_thread = this.fields.message_ids;
|
||||
var thread = record_thread.thread;
|
||||
thread.instantiate_composition_form('comment', true, false, 0, action.context);
|
||||
@@ -40,14 +46,11 @@ openerp.mail = function(session) {
|
||||
* the various Chatter widgets.
|
||||
*
|
||||
* Some regular expressions not used anymore, kept because I want to
|
||||
* - (^|\s)@((\w|@|\.)*): @login@log.log, supports inner '@' for
|
||||
* logins that are emails
|
||||
* - (^|\s)@((\w|@|\.)*): @login@log.log
|
||||
* 1. '(void)'
|
||||
* 2. login@log.log
|
||||
* - (^|\s)\[(\w+).(\w+),(\d)\|*((\w|[@ .,])*)\]: [ir.attachment,3|My Label],
|
||||
* for internal links to model ir.attachment, id=3, and with
|
||||
* optional label 'My Label'. Note that having a '|Label' is not
|
||||
* mandatory, because the regex should still be correct.
|
||||
* for internal links
|
||||
* 1. '(void)'
|
||||
* 2. 'ir'
|
||||
* 3. 'attachment'
|
||||
@@ -62,7 +65,7 @@ openerp.mail = function(session) {
|
||||
return session_prefix + '/web/binary/image?session_id=' + session_id + '&model=' + model + '&field=' + field + '&id=' + (id || '');
|
||||
},
|
||||
|
||||
/** checks if tue current user is the message author */
|
||||
/** check if the current user is the message author */
|
||||
is_author: function (widget, message_user_id) {
|
||||
return (widget.session && widget.session.uid != 0 && widget.session.uid == message_user_id);
|
||||
},
|
||||
@@ -71,7 +74,6 @@ openerp.mail = function(session) {
|
||||
* - :name - shortcut to an image
|
||||
*/
|
||||
do_replace_expressions: function (string) {
|
||||
var self = this;
|
||||
var icon_list = ['al', 'pinky']
|
||||
/* special shortcut: :name, try to find an icon if in list */
|
||||
var regex_login = new RegExp(/(^|\s):((\w)*)/g);
|
||||
@@ -93,8 +95,7 @@ openerp.mail = function(session) {
|
||||
* ------------------------------------------------------------
|
||||
*
|
||||
* This widget handles the display of a form to compose a new message.
|
||||
* This form is an OpenERP form_view, build on a mail.compose.message
|
||||
* wizard.
|
||||
* This form is a mail.compose.message form_view.
|
||||
*/
|
||||
|
||||
mail.ComposeMessage = session.web.Widget.extend({
|
||||
@@ -102,14 +103,10 @@ openerp.mail = function(session) {
|
||||
|
||||
/**
|
||||
* @param {Object} parent parent
|
||||
* @param {Object} [options]
|
||||
* @param {Object} [options.context] context
|
||||
* @param {String} [context.res_model] res_model of document [REQUIRED]
|
||||
* @param {Number} [context.res_id] res_id of record [REQUIRED]
|
||||
* @param {String} [context.composition_mode] mail.compose.message.mode
|
||||
* (see composition wizard)
|
||||
* @param {Number} [context.msg_id] id of a message in case we are in
|
||||
* reply mode
|
||||
* @param {Object} [options]
|
||||
* @param {Object} [options.context] context passed to the
|
||||
* mail.compose.message DataSetSearch. Please refer to this model
|
||||
* for more details about fields and default values.
|
||||
*/
|
||||
init: function (parent, options) {
|
||||
var self = this;
|
||||
@@ -120,9 +117,9 @@ openerp.mail = function(session) {
|
||||
this.options.form_xml_id = options.form_xml_id || 'email_compose_message_wizard_form_chatter';
|
||||
this.options.form_view_id = options.form_view_id || false;
|
||||
// debug
|
||||
console.groupCollapsed('New ComposeMessage: model', this.options.context.default_res_model, ', id', this.options.context.default_res_id);
|
||||
console.log('context:', this.options.context);
|
||||
console.groupEnd();
|
||||
// console.groupCollapsed('New ComposeMessage: model', this.options.context.default_res_model, ', id', this.options.context.default_res_id);
|
||||
// console.log('context:', this.options.context);
|
||||
// console.groupEnd();
|
||||
},
|
||||
|
||||
start: function () {
|
||||
@@ -132,33 +129,22 @@ openerp.mail = function(session) {
|
||||
this.$el.find('img.oe_mail_icon').attr('src', user_avatar);
|
||||
this.$el.find('div.oe_mail_msg_content').empty();
|
||||
// create a context for the dataset and default_get of the wizard
|
||||
var context = this._update_context({});
|
||||
console.log(context);
|
||||
var context = _.extend({}, this.options.context);
|
||||
this.ds_compose = new session.web.DataSetSearch(this, 'mail.compose.message', context);
|
||||
// find the id of the view to display in the chatter form
|
||||
var data_ds = new session.web.DataSetSearch(this, 'ir.model.data');
|
||||
return data_ds.call('get_object_reference', ['mail', this.options.form_xml_id]).pipe(this.proxy('create_form_view'));
|
||||
},
|
||||
|
||||
/** Update the context of the compose wizard */
|
||||
_update_context: function (dest_context) {
|
||||
// TDE TOCHECK: after posting, back to reply mode !
|
||||
_.extend(dest_context, this.options.context, {
|
||||
'mail.compose.message.mode': this.options.context.composition_mode,
|
||||
});
|
||||
if (this.options.context.composition_mode == 'comment') {
|
||||
// _.extend(dest_context, {'default_res_id': this.options.res_id});
|
||||
if (this.options.form_view_id) {
|
||||
return this.create_form_view();
|
||||
}
|
||||
else if (this.options.context.composition_mode == 'reply') {
|
||||
_.extend(dest_context, {'active_id': this.options.context.msg_id});
|
||||
else {
|
||||
var data_ds = new session.web.DataSetSearch(this, 'ir.model.data');
|
||||
return data_ds.call('get_object_reference', ['mail', this.options.form_xml_id]).pipe(this.proxy('create_form_view'));
|
||||
}
|
||||
return dest_context
|
||||
},
|
||||
|
||||
/** Create a FormView, then append it to the to widget DOM. */
|
||||
create_form_view: function (form_view_id) {
|
||||
this.options.form_view_id = form_view_id[1] || false;
|
||||
create_form_view: function (new_form_view_id) {
|
||||
var self = this;
|
||||
this.options.form_view_id = (new_form_view_id && new_form_view_id[1]) || this.options.form_view_id;
|
||||
// destroy previous form_view if any
|
||||
if (this.form_view) { this.form_view.destroy(); }
|
||||
// create the FormView
|
||||
@@ -177,14 +163,15 @@ openerp.mail = function(session) {
|
||||
},
|
||||
|
||||
/**
|
||||
* Reinitialize the widget field values to the default values. The
|
||||
* purpose is to avoid to destroy and re-build a form view. Default
|
||||
* values are therefore given as for an on_change. */
|
||||
refresh: function (options_update_values) {
|
||||
var self = this;
|
||||
this.options.context = _.extend(this.options.context, options_update_values || {});
|
||||
* Reinitialize the widget field values to the default values obtained
|
||||
* using default_get on mail.compose.message. This allows to reinitialize
|
||||
* the widget without having to rebuild a complete form view.
|
||||
* @param {Object} new_context: context of the refresh */
|
||||
refresh: function (new_context) {
|
||||
if (! this.form_view) return;
|
||||
this.ds_compose.context = this._update_context(this.ds_compose.context);
|
||||
var self = this;
|
||||
this.options.context = _.extend(this.options.context, new_context || {});
|
||||
this.ds_compose.context = _.extend(this.ds_compose.context, this.options.context);
|
||||
return this.ds_compose.call('default_get', [
|
||||
['subject', 'body_text', 'body', 'attachment_ids', 'partner_ids', 'composition_mode',
|
||||
'model', 'res_id', 'parent_id', 'content_subtype'],
|
||||
@@ -192,13 +179,6 @@ openerp.mail = function(session) {
|
||||
]).then( function (result) { self.form_view.on_processed_onchange({'value': result}, []); });
|
||||
},
|
||||
|
||||
/**
|
||||
* Override-hack of do_action: clean the form */
|
||||
do_action: function(action, on_close) {
|
||||
console.log('compose_message do_action', action, on_close);
|
||||
return this._super(action, on_close);
|
||||
},
|
||||
|
||||
/**
|
||||
* Bind events in the widget. Each event is slightly described
|
||||
* in the function. */
|
||||
@@ -223,9 +203,6 @@ openerp.mail = function(session) {
|
||||
* - - sub message (parent_id = root message)
|
||||
* - - - sub sub message (parent id = sub message)
|
||||
* - - sub message (parent_id = root message)
|
||||
* This widget has 2 ways of initialization, either you give records
|
||||
* to be rendered, either it will fetch [limit] messages related to
|
||||
* [res_model]:[res_id].
|
||||
*/
|
||||
|
||||
mail.Thread = session.web.Widget.extend({
|
||||
@@ -234,71 +211,54 @@ openerp.mail = function(session) {
|
||||
/**
|
||||
* @param {Object} parent parent
|
||||
* @param {Object} [options]
|
||||
* @param {String} [options.res_model] res_model of document [REQUIRED]
|
||||
* @param {Number} [options.res_id] res_id of record [REQUIRED]
|
||||
* @param {Number} [options.uid] user id [REQUIRED]
|
||||
* @param {Bool} [options.parent_id=false] parent_id of message
|
||||
* @param {Number} [options.thread_level=0] number of levels in the thread
|
||||
* (only 0 or 1 currently)
|
||||
* @param {Bool} [options.is_wall=false] thread is displayed in the wall
|
||||
* @param {Number} [options.msg_more_limit=150] number of character to
|
||||
* @param {Object} [options.context] context of the thread. It should
|
||||
contain at least default_model, default_res_id. Please refer to
|
||||
the ComposeMessage widget for more information about it.
|
||||
* @param {Number} [options.thread_level=0] number of thread levels
|
||||
* @param {Number} [options.message_ids=null] ids for message_fetch
|
||||
* @param {Number} [options.message_data=null] already formatted message
|
||||
data, for subthreads getting data from their parent
|
||||
* @param {Boolean} [options.composer] use the advanced composer, or
|
||||
the default basic textarea if not set
|
||||
* @param {Number} [options.truncate_limit=250] number of character to
|
||||
* display before having a "show more" link; note that the text
|
||||
* will not be truncated if it does not have 110% of the parameter
|
||||
* (ex: 110 characters needed to be truncated and be displayed as
|
||||
* a 100-characters message)
|
||||
* @param {Number} [options.limit=100] maximum number of messages to fetch
|
||||
* @param {Number} [options.offset=0] offset for fetching messages
|
||||
* @param {Number} [options.records=null] records to show instead of fetching messages
|
||||
*/
|
||||
init: function(parent, options) {
|
||||
console.log(parent);
|
||||
this._super(parent);
|
||||
// options
|
||||
this.options = options || {};
|
||||
this.options.domain = options.domain || [];
|
||||
this.options.context = options.context || {};
|
||||
// check in parents, should not define multiple times
|
||||
this.options.context.res_model = options.context.res_model || 'mail.thread';
|
||||
this.options.context.res_id = options.context.res_id || false;
|
||||
this.options.context.parent_id = options.context.parent_id || false;
|
||||
this.options.context = _.extend({
|
||||
default_model: 'mail.thread',
|
||||
default_res_id: 0,
|
||||
default_parent_id: false }, options.context || {});
|
||||
this.options.thread_level = options.thread_level || 0;
|
||||
this.options.composer = options.composer || false;
|
||||
// TDE: not sure, here for testing / compatibility
|
||||
this.options.records = options.records || null;
|
||||
this.options.ids = options.ids || null;
|
||||
this.options.message_ids = options.message_ids || null;
|
||||
this.options.message_data = options.message_data || null;
|
||||
// datasets and internal vars
|
||||
this.ds_post = new session.web.DataSetSearch(this, this.options.context.res_model);
|
||||
this.ds_notif = new session.web.DataSetSearch(this, 'mail.notification');
|
||||
this.ds_msg = new session.web.DataSetSearch(this, 'mail.message');
|
||||
this.ds_thread = new session.web.DataSetSearch(this, this.options.context.default_model);
|
||||
this.ds_notification = new session.web.DataSetSearch(this, 'mail.notification');
|
||||
this.ds_message = new session.web.DataSetSearch(this, 'mail.message');
|
||||
// display customization vars
|
||||
this.display = {};
|
||||
this.display.truncate_limit = options.truncate_limit || 250;
|
||||
this.display.show_header_compose = options.show_header_compose || false;
|
||||
this.display.show_reply = options.show_reply || false;
|
||||
this.display.show_delete = options.show_delete || false;
|
||||
this.display.show_hide = options.show_hide || false;
|
||||
this.display.show_reply_by_email = options.show_reply_by_email || false;
|
||||
this.display.show_more = options.show_more || false;
|
||||
// for search view
|
||||
this.search = {'domain': [], 'context': {}, 'groupby': {}}
|
||||
this.search_results = {'domain': [], 'context': {}, 'groupby': {}}
|
||||
// debug
|
||||
console.groupCollapsed('New Thread: model', this.options.context.res_model, 'id', this.options.context.res_id, 'parent_id', this.options.context.parent_id, 'thread level', this.options.thread_level);
|
||||
console.log('records:', this.options.records, 'ids:', this.options.ids);
|
||||
console.log('options:', this.options);
|
||||
console.log('display:', this.display);
|
||||
console.groupEnd();
|
||||
this.display = {
|
||||
truncate_limit: options.truncate_limit || 250,
|
||||
show_header_compose: options.show_header_compose || false,
|
||||
show_reply: options.show_reply || false,
|
||||
show_delete: options.show_delete || false,
|
||||
show_hide: options.show_hide || false,
|
||||
show_reply_by_email: options.show_reply_by_email || false,
|
||||
show_more: options.show_more || false,
|
||||
}
|
||||
},
|
||||
|
||||
start: function() {
|
||||
// TDE TODO: check for deferred, not sure it is correct
|
||||
this._super.apply(this, arguments);
|
||||
this.bind_events();
|
||||
// display messages: either given by parent, either fetch new ones
|
||||
if (this.options.records) var display_done = this.message_display(this.options.records);
|
||||
else var display_done = this.message_fetch();
|
||||
// customize display
|
||||
this.display_user_avatar();
|
||||
$.when(display_done).then(this.proxy('do_customize_display'));
|
||||
// fetch and display message, using message_ids if set
|
||||
var display_done = $.when(this.message_fetch(true, [], {})).then(this.proxy('do_customize_display'));
|
||||
// add message composition form view
|
||||
if (this.display.show_header_compose && this.options.composer) {
|
||||
var compose_done = this.instantiate_composition_form();
|
||||
@@ -309,6 +269,7 @@ openerp.mail = function(session) {
|
||||
/** Customize the display
|
||||
* - show_header_compose: show the composition form in the header */
|
||||
do_customize_display: function() {
|
||||
this.display_user_avatar();
|
||||
if (this.display.show_header_compose) { this.$el.find('div.oe_mail_thread_action').eq(0).show(); }
|
||||
},
|
||||
|
||||
@@ -366,7 +327,10 @@ openerp.mail = function(session) {
|
||||
event.stopPropagation();
|
||||
var msg_id = event.srcElement.dataset.msg_id;
|
||||
if (! msg_id) return false;
|
||||
self.compose_message_widget.refresh({'composition_mode': 'reply', 'msg_id': parseInt(msg_id)});
|
||||
self.compose_message_widget.refresh({
|
||||
'default_composition_mode': 'reply',
|
||||
'default_parent_id': parseInt(msg_id),
|
||||
'default_content_subtype': 'html'} );
|
||||
});
|
||||
},
|
||||
|
||||
@@ -375,24 +339,26 @@ openerp.mail = function(session) {
|
||||
* Normally it should be called only when clicking on 'Post/Send'
|
||||
* in the composition form. */
|
||||
do_action: function(action, on_close) {
|
||||
console.log('thread do_action', action, on_close, this);
|
||||
this.message_clean();
|
||||
this.message_fetch();
|
||||
if (this.compose_message_widget) {
|
||||
this.compose_message_widget.refresh(); }
|
||||
this.compose_message_widget.refresh({
|
||||
'default_composition_mode': 'comment',
|
||||
'default_parent_id': this.options.default_parent_id,
|
||||
'default_content_subtype': 'plain'} );
|
||||
}
|
||||
return this._super(action, on_close);
|
||||
},
|
||||
|
||||
/** Instantiate the composition form, with parameters coming from thread parameters */
|
||||
instantiate_composition_form: function(mode, formatting, msg_id, context) {
|
||||
/** Instantiate the composition form, with every parameters in context
|
||||
or in the widget context. */
|
||||
instantiate_composition_form: function(context) {
|
||||
if (this.compose_message_widget) {
|
||||
this.compose_message_widget.destroy();
|
||||
}
|
||||
this.compose_message_widget = new mail.ComposeMessage(this, {
|
||||
'context': {
|
||||
'default_model': this.options.context.res_model, 'default_res_id': this.options.context.res_id,
|
||||
'composition_mode': mode || 'comment', 'msg_id': msg_id }
|
||||
});
|
||||
'context': _.extend(context || {}, this.options.context),
|
||||
});
|
||||
var composition_node = this.$el.find('div.oe_mail_thread_action');
|
||||
composition_node.empty();
|
||||
var compose_done = this.compose_message_widget.appendTo(composition_node);
|
||||
@@ -405,35 +371,33 @@ openerp.mail = function(session) {
|
||||
},
|
||||
|
||||
/** Fetch messages
|
||||
* @param {Array} additional_domain
|
||||
* @param {Object} additional_context
|
||||
* @param {Bool} initial_mode: initial mode: try to use message_data or
|
||||
* message_ids, if nothing available perform a message_read; otherwise
|
||||
* directly perform a message_read
|
||||
* @param {Array} additional_domain: added to options.domain
|
||||
* @param {Object} additional_context: added to options.context
|
||||
*/
|
||||
message_fetch: function (additional_domain, additional_context) {
|
||||
message_fetch: function (initial_mode, additional_domain, additional_context) {
|
||||
var self = this;
|
||||
// Update the domain and context
|
||||
this.search['domain'] = _.union(this.options.domain, this.search_results.domain);
|
||||
this.search['context'] = _.extend(this.options.context, this.search_results.context);
|
||||
if (additional_domain) var fetch_domain = this.search['domain'].concat(additional_domain);
|
||||
else var fetch_domain = this.search['domain'];
|
||||
if (additional_context) var fetch_context = _.extend(this.search['context'], additional_context);
|
||||
else var fetch_context = this.search['context'];
|
||||
|
||||
// TODO first use: use IDS, otherwise set false
|
||||
|
||||
var read_defer = this.ds_msg.call('message_read',
|
||||
[false, fetch_domain, this.options.thread_level, undefined, fetch_context]
|
||||
// domain and context: options + additional
|
||||
fetch_domain = _.flatten([this.options.domain, additional_domain || []], true)
|
||||
fetch_context = _.extend(this.options.context, additional_context || {})
|
||||
// if message_ids is set: try to use it
|
||||
if (initial_mode && this.options.message_data) {
|
||||
return this.message_display(this.options.message_data);
|
||||
}
|
||||
return this.ds_message.call('message_read',
|
||||
[(initial_mode && this.options.message_ids) || false, fetch_domain, this.options.thread_level, undefined, fetch_context]
|
||||
).then(this.proxy('message_display'));
|
||||
return read_defer;
|
||||
},
|
||||
|
||||
/* Display a list of records
|
||||
* - */
|
||||
* A specific case is done for 'expandable' messages that are messages
|
||||
displayed under a 'show more' button form
|
||||
*/
|
||||
message_display: function (records) {
|
||||
var self = this;
|
||||
var _expendable = false;
|
||||
console.groupCollapsed('message_display');
|
||||
console.log('records', records)
|
||||
console.groupEnd();
|
||||
_(records).each(function (record) {
|
||||
if (record.type == 'expandable') {
|
||||
_expendable = true;
|
||||
@@ -443,14 +407,19 @@ openerp.mail = function(session) {
|
||||
}
|
||||
else {
|
||||
self.display_record(record);
|
||||
// if (self.options.thread_level >= 0) {
|
||||
self.thread = new mail.Thread(self, {
|
||||
'context': { 'res_model': record.model, 'res_id': record.res_id, 'parent_id': record.id},
|
||||
'context': {
|
||||
'default_model': record.model,
|
||||
'default_id': record.res_id,
|
||||
'default_parent_id': record.id },
|
||||
'message_data': record.child_ids, 'thread_level': self.options.thread_level-1,
|
||||
'show_header_compose': false, 'show_reply': self.options.thread_level > 1,
|
||||
'show_hide': self.display.show_hide, 'show_delete': self.display.show_delete,
|
||||
'uid': self.options.uid, 'records': record.child_ids, 'thread_level': (self.options.thread_level-1),
|
||||
});
|
||||
self.$el.find('li.oe_mail_thread_msg:last').append('<div class="oe_mail_thread_subthread"/>');
|
||||
self.thread.appendTo(self.$el.find('div.oe_mail_thread_subthread:last'));
|
||||
// }
|
||||
}
|
||||
});
|
||||
if (! _expendable) {
|
||||
@@ -522,7 +491,7 @@ openerp.mail = function(session) {
|
||||
|
||||
/** Action: 'shows more' to fetch new messages */
|
||||
do_message_fetch: function () {
|
||||
return this.message_fetch(this.fetch_more_domain, this.fetch_more_context);
|
||||
return this.message_fetch(false, this.fetch_more_domain, this.fetch_more_context);
|
||||
},
|
||||
|
||||
// TDE: keep currently because need something similar
|
||||
@@ -572,19 +541,18 @@ openerp.mail = function(session) {
|
||||
|
||||
/** mail_thread widget: thread of comments */
|
||||
mail.RecordThread = session.web.form.AbstractField.extend({
|
||||
// QWeb template to use when rendering the object
|
||||
template: 'mail.record_thread',
|
||||
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.options.domain = this.options.domain || [];
|
||||
this.options.context = {'res_model': 'mail.thread', 'res_id': false, 'parent_id': false};
|
||||
this.options.context = {'default_model': 'mail.thread', 'default_res_id': false};
|
||||
this.options.thread_level = this.options.thread_level || 0;
|
||||
this.thread_list = [];
|
||||
},
|
||||
|
||||
start: function() {
|
||||
// this._super.apply(this, arguments);
|
||||
this._super.apply(this, arguments);
|
||||
// NB: all the widget should be modified to check the actual_mode property on view, not use
|
||||
// any other method to know if the view is in create mode anymore
|
||||
this.view.on("change:actual_mode", this, this._check_visibility);
|
||||
@@ -608,14 +576,14 @@ openerp.mail = function(session) {
|
||||
return;
|
||||
}
|
||||
// update context
|
||||
this.options.context['res_id'] = this.view.datarecord.id;
|
||||
this.options.context['res_model'] = this.view.model;
|
||||
_.extend(this.options.context, {
|
||||
default_res_id: this.view.datarecord.id,
|
||||
default_model: this.view.model });
|
||||
// create and render Thread widget
|
||||
this.$el.find('div.oe_mail_recthread_main').empty();
|
||||
for (var i in this.thread_list) { this.thread_list[i].destroy(); }
|
||||
console.log(this);
|
||||
var thread = new mail.Thread(self, {
|
||||
'context': this.options.context, 'uid': this.session.uid,
|
||||
'context': this.options.context,
|
||||
'thread_level': this.options.thread_level, 'show_header_compose': true,
|
||||
'show_delete': true, 'composer': true });
|
||||
this.thread_list.push(thread);
|
||||
@@ -644,7 +612,7 @@ openerp.mail = function(session) {
|
||||
* @param {Object} [options]
|
||||
* @param {Number} [options.domain] domain on the Wall, is an array.
|
||||
* @param {Number} [options.domain] context, is an object. It should
|
||||
* contain res_model, res_id, parent_id, to give it to the threads.
|
||||
* contain default_model, default_res_id, to give it to the threads.
|
||||
*/
|
||||
init: function (parent, options) {
|
||||
this._super(parent);
|
||||
@@ -653,7 +621,7 @@ openerp.mail = function(session) {
|
||||
this.options.context = options.context || {};
|
||||
this.options.thread_level = options.thread_level || 1;
|
||||
this.thread_list = [];
|
||||
this.ds_msg = new session.web.DataSet(this, 'mail.message');
|
||||
this.ds_msg = new session.web.DataSetSearch(this, 'mail.message');
|
||||
// for search view
|
||||
this.search = {'domain': [], 'context': {}, 'groupby': {}}
|
||||
this.search_results = {'domain': [], 'context': {}, 'groupby': {}}
|
||||
@@ -662,29 +630,15 @@ openerp.mail = function(session) {
|
||||
start: function () {
|
||||
this._super.apply(this, arguments);
|
||||
var search_view_ready = this.load_search_view({}, false);
|
||||
var thread_displayed = this.display_thread();
|
||||
var thread_displayed = this.message_display();
|
||||
return (search_view_ready && thread_displayed);
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
for (var i in this.thrad_list) { this.thread_list[i].destroy(); }
|
||||
for (var i in this.thread_list) { this.thread_list[i].destroy(); }
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Override-hack of do_action: automatically reload the chatter.
|
||||
* Normally it should be called only when clicking on 'Post/Send'
|
||||
* in the composition form. */
|
||||
//TDE: still useful ? TO CHECK
|
||||
do_action: function(action, on_close) {
|
||||
console.log('wall do_action');
|
||||
if (this.compose_message_widget) {
|
||||
this.compose_message_widget.refresh(); }
|
||||
this.message_clean();
|
||||
this.display_thread();
|
||||
return this._super(action, on_close);
|
||||
},
|
||||
|
||||
/**
|
||||
* Load the mail.message search view
|
||||
* @param {Object} defaults ??
|
||||
@@ -717,7 +671,7 @@ openerp.mail = function(session) {
|
||||
self.search_results['domain'] = results.domain;
|
||||
self.search_results['groupby'] = results.group_by;
|
||||
self.message_clean();
|
||||
return self.display_thread();
|
||||
return self.message_display();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -726,14 +680,12 @@ openerp.mail = function(session) {
|
||||
this.$el.find('ul.oe_mail_wall_threads').empty();
|
||||
},
|
||||
|
||||
/** Display comments
|
||||
* @param {Array} records tree structure of records
|
||||
*/
|
||||
display_thread: function () {
|
||||
/** Display the Wall threads */
|
||||
message_display: function () {
|
||||
var render_res = session.web.qweb.render('mail.wall_thread_container', {});
|
||||
$('<li class="oe_mail_wall_thread">').html(render_res).appendTo(this.$el.find('ul.oe_mail_wall_threads'));
|
||||
var thread = new mail.Thread(this, {
|
||||
'domain': this.options.domain, 'context': this.options.context, 'uid': this.session.uid,
|
||||
'domain': this.options.domain, 'context': this.options.context,
|
||||
'thread_level': this.options.thread_level, 'composer': true,
|
||||
// display options
|
||||
'show_header_compose': true, 'show_reply': this.options.thread_level > 0,
|
||||
|
||||
@@ -9,7 +9,7 @@ openerp_mail_followers = function(session, mail) {
|
||||
* mail_followers Widget
|
||||
* ------------------------------------------------------------
|
||||
*
|
||||
* This widget handles the display of a list of records as a vetical
|
||||
* This widget handles the display of a list of records as a vertical
|
||||
* list, with an image on the left. The widget itself is a floatting
|
||||
* right-sided box.
|
||||
* This widget is mainly used to display the followers of records
|
||||
@@ -71,25 +71,17 @@ openerp_mail_followers = function(session, mail) {
|
||||
this.$el.find('div.oe_mail_recthread_aside').hide();
|
||||
return;
|
||||
}
|
||||
if (this.getParent().fields.message_is_follower === undefined) {
|
||||
// TDE: TMP, need to change all form views
|
||||
this.message_is_follower = false;
|
||||
}
|
||||
else {
|
||||
this.message_is_follower = this.getParent().fields.message_is_follower.get_value();
|
||||
}
|
||||
return this.fetch_followers(value_);
|
||||
},
|
||||
|
||||
fetch_followers: function (value_) {
|
||||
return this.ds_follow.call('read', [value_ || this.get_value(), ['name']]).then(this.proxy('display_followers'));
|
||||
return this.ds_follow.call('read', [value_ || this.get_value(), ['name', 'user_ids']]).then(this.proxy('display_followers'));
|
||||
},
|
||||
|
||||
/**
|
||||
* Display the followers.
|
||||
* TODO: replace the is_follower check by fields read */
|
||||
/** Display the followers, evaluate is_follower directly */
|
||||
display_followers: function (records) {
|
||||
var self = this;
|
||||
this.message_is_follower = _.indexOf(_.flatten(_.pluck(records, 'user_ids')), this.session.uid) != -1;
|
||||
var node_user_list = this.$el.find('ul.oe_mail_followers_display').empty();
|
||||
this.$el.find('div.oe_mail_recthread_followers h4').html(this.options.title + ' (' + records.length + ')');
|
||||
_(records).each(function (record) {
|
||||
@@ -137,7 +129,8 @@ openerp_mail_followers = function(session, mail) {
|
||||
},
|
||||
|
||||
do_follow: function () {
|
||||
return this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id]]).pipe(this.proxy('set_value'));
|
||||
var context = new session.web.CompoundContext(this.build_context(), {'read_back': true});
|
||||
return this.ds_model.call('message_subscribe_users', [[this.view.datarecord.id], undefined, context]).pipe(this.proxy('set_value'));
|
||||
},
|
||||
|
||||
//fetch subtype from subtype model
|
||||
@@ -150,7 +143,8 @@ openerp_mail_followers = function(session, mail) {
|
||||
},
|
||||
|
||||
do_unfollow: function () {
|
||||
return this.ds_model.call('message_unsubscribe_users', [[this.view.datarecord.id]]).pipe(this.proxy('set_value'));
|
||||
var context = new session.web.CompoundContext(this.build_context(), {'read_back': true});
|
||||
return this.ds_model.call('message_unsubscribe_users', [[this.view.datarecord.id], undefined, context]).pipe(this.proxy('set_value'));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
Template used to display the communication history in documents
|
||||
form view.
|
||||
-->
|
||||
<div t-name="mail.record_thread" class="oe_mail_recthread">
|
||||
<div t-name="mail.record_thread">
|
||||
<!-- <h4>History and Comments</h4> -->
|
||||
<div class="oe_mail_recthread_main">
|
||||
<!-- contains the document thread -->
|
||||
|
||||
@@ -85,6 +85,7 @@ class test_mail(common.TransactionCase):
|
||||
self.mail_message = self.registry('mail.message')
|
||||
self.mail_notification = self.registry('mail.notification')
|
||||
self.mail_followers = self.registry('mail.followers')
|
||||
self.mail_message_subtype = self.registry('mail.message.subtype')
|
||||
self.res_users = self.registry('res.users')
|
||||
self.res_partner = self.registry('res.partner')
|
||||
|
||||
@@ -250,7 +251,7 @@ class test_mail(common.TransactionCase):
|
||||
_attachments = [('First', 'My first attachment'), ('Second', 'My second attachment')]
|
||||
|
||||
# CASE1: post comment, body and subject specified
|
||||
msg_id = self.mail_group.message_post(cr, uid, self.group_pigs_id, body=_body1, subject=_subject, msg_type='comment')
|
||||
msg_id = self.mail_group.message_post(cr, uid, self.group_pigs_id, body=_body1, subject=_subject, type='comment')
|
||||
message = self.mail_message.browse(cr, uid, msg_id)
|
||||
mail_ids = self.mail_mail.search(cr, uid, [], limit=1)
|
||||
mail = self.mail_mail.browse(cr, uid, mail_ids[0])
|
||||
@@ -280,7 +281,7 @@ class test_mail(common.TransactionCase):
|
||||
|
||||
# CASE2: post an email with attachments, parent_id, partner_ids
|
||||
# TESTS: automatic subject, signature in body_html, attachments propagation
|
||||
msg_id2 = self.mail_group.message_post(cr, uid, self.group_pigs_id, body=_body2, msg_type='email',
|
||||
msg_id2 = self.mail_group.message_post(cr, uid, self.group_pigs_id, body=_body2, type='email',
|
||||
partner_ids=[(6, 0, [p_d_id])], parent_id=msg_id, attachments=_attachments)
|
||||
message = self.mail_message.browse(cr, uid, msg_id2)
|
||||
mail_ids = self.mail_mail.search(cr, uid, [], limit=1)
|
||||
@@ -353,7 +354,7 @@ class test_mail(common.TransactionCase):
|
||||
# CASE1: comment group_pigs with body_text and subject
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': _subject, 'body_text': _body_text, 'partner_ids': [(4, p_c_id), (4, p_d_id)]},
|
||||
{'mail.compose.message.mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id})
|
||||
{'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_pigs_id})
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
# Test: mail.compose.message: model, res_id
|
||||
self.assertEqual(compose.model, 'mail.group', 'mail.compose.message incorrect model')
|
||||
@@ -378,7 +379,7 @@ class test_mail(common.TransactionCase):
|
||||
message.write({'subject': _subject})
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])]},
|
||||
{'mail.compose.message.mode': 'reply', 'default_model': 'mail.thread', 'default_res_id': self.group_pigs_id, 'active_id': message.id})
|
||||
{'default_composition_mode': 'reply', 'default_model': 'mail.thread', 'default_res_id': self.group_pigs_id, 'default_parent_id': message.id})
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
|
||||
# Test: form view methods
|
||||
@@ -538,3 +539,37 @@ class test_mail(common.TransactionCase):
|
||||
msg1.refresh()
|
||||
self.assertEqual(5, len(group_pigs.message_ids), 'group should contain 5 messages')
|
||||
self.assertEqual(2, len(msg1.child_ids), 'msg1 should have 2 children now')
|
||||
|
||||
def test_60_message_subtype(self):
|
||||
""" Tests designed for message_subtype. """
|
||||
cr, uid = self.cr, self.uid
|
||||
self.res_users.write(cr, uid, [uid], {'signature': 'Admin', 'email': 'a@a'})
|
||||
user_admin = self.res_users.browse(cr, uid, uid)
|
||||
group_pigs = self.mail_group.browse(cr, uid, self.group_pigs_id)
|
||||
|
||||
# 0 - Admin
|
||||
p_a_id = user_admin.partner_id.id
|
||||
# Subscribe #1,
|
||||
self.mail_group_model_id = self.ir_model.search(cr, uid, [('model','=', 'mail.group')])[0]
|
||||
subtype_ids = self.mail_message_subtype.search(cr, uid, [])
|
||||
self.mail_message_subtype.write(cr,uid,subtype_ids,{'model_ids':[(4,self.mail_group_model_id )]})
|
||||
group_pigs.message_subscribe_users([uid])
|
||||
|
||||
# Mail data
|
||||
_subject = 'Pigs'
|
||||
_mail_subject = '%s posted on %s' % (user_admin.name, group_pigs.name)
|
||||
_body1 = 'Pigs rules'
|
||||
_mail_body1 = 'Pigs rules\n<pre>Admin</pre>\n'
|
||||
_mail_bodyalt1 = 'Pigs rules\nAdmin'
|
||||
_body2 = '<html>Pigs rules</html>'
|
||||
_mail_body2 = '<html>Pigs rules\n<pre>Admin</pre>\n</html>'
|
||||
_mail_bodyalt2 = 'Pigs rules\nAdmin\n'
|
||||
filter_subtype_id = self.mail_message_subtype.search(cr, uid, [('default','=',True)])
|
||||
# Post comment with body and subject, comment preference
|
||||
msg_id = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body1, subject=_subject, type='comment',subtype='email')
|
||||
notif_ids = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id)])
|
||||
self.assertTrue(len(notif_ids) >= 1,"subtype is email and show notification on wall")
|
||||
# New post: test automatic subject, signature in html, add a partner, email preference, parent_id previous message
|
||||
msg_id2 = self.mail_group.message_post(cr, uid, [self.group_pigs_id], body=_body2,subject=_subject, type='email', subtype='other')
|
||||
notif_ids2 = self.mail_notification.search(cr, uid, [('message_id', '=', msg_id2)])
|
||||
self.assertTrue(len(notif_ids2) == 0,"subtype is false cannot show notification on wall")
|
||||
|
||||
@@ -35,8 +35,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
""" Generic message composition wizard. You may inherit from this wizard
|
||||
at model and view levels to provide specific features.
|
||||
|
||||
The behavior of the wizard can be modified through the context key
|
||||
mail.compose.message.mode:
|
||||
The behavior of the wizard depends on the composition_mode field:
|
||||
- 'reply': reply to a previous message. The wizard is pre-populated
|
||||
via ``get_message_data``.
|
||||
- 'comment': new post on a record. The wizard is pre-populated via
|
||||
@@ -56,10 +55,11 @@ class mail_compose_message(osv.TransientModel):
|
||||
- default_model or active_model
|
||||
- default_res_id or active_id
|
||||
- reply: active_id of a message the user replies to
|
||||
- active_id: ID of a mail.message to which we are replying
|
||||
- default_parent_id or message_id or active_id: ID of the
|
||||
mail.message we reply to
|
||||
- message.res_model or default_model
|
||||
- message.res_id or default_res_id
|
||||
- mass_mailing mode: model and IDs of records the user mass-mails
|
||||
- mass_mail: model and IDs of records the user mass-mails
|
||||
- active_ids: record IDs
|
||||
- default_model or active_model
|
||||
"""
|
||||
@@ -81,7 +81,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
elif composition_mode == 'comment' and model and res_id:
|
||||
vals = self.get_record_data(cr, uid, model, res_id, context=context)
|
||||
elif composition_mode == 'mass_mail' and model and active_ids:
|
||||
vals = {'model': model, 'res_id': res_id, 'content_subtype': 'html'}
|
||||
vals = {'model': model, 'res_id': res_id}
|
||||
else:
|
||||
vals = {'model': model, 'res_id': res_id}
|
||||
if composition_mode:
|
||||
@@ -106,7 +106,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
'mail_compose_message_ir_attachments_rel',
|
||||
'wizard_id', 'attachment_id', 'Attachments'),
|
||||
'filter_id': fields.many2one('ir.filters', 'Filters'),
|
||||
'body_text': fields.text('Plain-text editor body'),
|
||||
'body_text': fields.text('Plain-text Contents'),
|
||||
'content_subtype': fields.char('Message content subtype', size=32, readonly=1,
|
||||
help="Type of message, usually 'html' or 'plain', used to select "\
|
||||
"plain-text or rich-text contents accordingly"),
|
||||
@@ -118,7 +118,6 @@ class mail_compose_message(osv.TransientModel):
|
||||
'body_text': lambda self,cr, uid, context={}: False,
|
||||
'body': lambda self,cr, uid, context={}: '',
|
||||
'subject': lambda self,cr, uid, context={}: False,
|
||||
'partner_ids': [],
|
||||
}
|
||||
|
||||
def notify(self, cr, uid, newid, context=None):
|
||||
@@ -270,7 +269,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
post_values['attachments'] += new_attachments
|
||||
post_values.update(email_dict)
|
||||
# post the message
|
||||
active_model_pool.message_post(cr, uid, [res_id], msg_type='comment', context=context, **post_values)
|
||||
active_model_pool.message_post(cr, uid, [res_id], type='comment', context=context, **post_values)
|
||||
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
|
||||
@@ -6,34 +6,43 @@
|
||||
<field name="model">mail.compose.message</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Compose Email" version="7.0">
|
||||
<field name="composition_mode" nolabel="1" invisible="1"/>
|
||||
<field name="model" nolabel="1" invisible="1"/>
|
||||
<field name="res_id" nolabel="1" invisible="1"/>
|
||||
<field name="parent_id" nolabel="1" invisible="1"/>
|
||||
<field name="content_subtype" nolabel="1" invisible="1"/>
|
||||
<group>
|
||||
<field name="composition_mode" invisible="1"/>
|
||||
<field name="model" invisible="1"/>
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="author_id"/>
|
||||
<field name="partner_ids"/>
|
||||
<field name="subject" widget="char" size="512"/>
|
||||
<field name="message_id"/>
|
||||
<field name="subject" placeholder="Subject..."/>
|
||||
<field name="partner_ids" widget="many2many_tags" placeholder="Add contacts to notify..."
|
||||
context="{'force_create':True}"
|
||||
on_change="onchange_partner_ids(partner_ids)"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<notebook>
|
||||
<page string="Body">
|
||||
<field name="body" colspan="4" nolabel="1" height="300" width="300"/>
|
||||
<field name="body_text" nolabel="1"
|
||||
attrs="{'invisible':[('content_subtype', '=', 'html')]}"/>
|
||||
<field name="body" nolabel="1"
|
||||
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>
|
||||
</page>
|
||||
<page string="Attachments">
|
||||
<field name="attachment_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<footer>
|
||||
<button name="send_mail" string="Send" type="object" class="oe_highlight" />
|
||||
<button string="Send" name="send_mail" type="object" class="oe_highlight" />
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
<div class="oe_right">
|
||||
<button string="" name="toggle_content_subtype" type="object" icon="/mail/static/src/img/formatting.png"
|
||||
help="Toggle advanced formatting mode"/>
|
||||
</div>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="email_compose_message_wizard_form_chatter">
|
||||
<field name="name">mail.compose.message.form</field>
|
||||
<field name="name">mail.compose.message.form.chatter</field>
|
||||
<field name="model">mail.compose.message</field>
|
||||
<field name="priority">18</field>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
@@ -3,29 +3,29 @@
|
||||
<data>
|
||||
<!-- Email tempalte -->
|
||||
<record id="email_template_1" model="email.template">
|
||||
<field name="name">Template for New Partner</field>
|
||||
<field name="name">welcome new partner</field>
|
||||
<field name="email_from">info@openerp.com</field>
|
||||
<field name="subject">Welcome in OpenERP Partner Channel!</field>
|
||||
<field name="subject">Welcome to the OpenERP Partner Channel!</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body">Hello, We are very happy to send Welcome message.</field>
|
||||
<field name="body_html">Hello, you will receive your welcome pack via email shortly.</field>
|
||||
</record>
|
||||
<record id="email_template_2" model="email.template">
|
||||
<field name="name">Template for Silver Partner</field>
|
||||
<field name="name">congrats silver partner</field>
|
||||
<field name="email_from">info@openerp.com</field>
|
||||
<field name="subject">Congratulation! You become now our Silver Partner.</field>
|
||||
<field name="subject">Congratulations! You are now a Silver Partner!</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body">Hello, We are happy to announce that you now become our Silver Partner.</field>
|
||||
<field name="body_html">Hi, we are delighted to welcome you among our Silver Partners as of today!</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_3" model="email.template">
|
||||
<field name="name">Template for Gold Partner</field>
|
||||
<field name="name">congrats gold partner</field>
|
||||
<field name="email_from">info@openerp.com</field>
|
||||
<field name="subject">Congratulation! You become our Gold Partner.</field>
|
||||
<field name="subject">Congratulations! You are now one of our Gold Partners!</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body">Hello, We are happy to announce that you become our Gold Partner.</field>
|
||||
<field name="body_html">Hi, we are delighted to let you know that you have entered the select circle of our Gold Partners</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tranisition -->
|
||||
<!-- Transition -->
|
||||
<record id="marketing_campaign_transition_0" model="marketing.campaign.transition">
|
||||
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
|
||||
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
|
||||
|
||||
@@ -40,7 +40,10 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello,Thanks for generous interest you have shown in the openERP.Regards,OpenERP Team,</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>Thanks for the genuine interest you have shown in OpenERP.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">For OpenERP OnDemand Free Trial 2010</field>
|
||||
</record>
|
||||
<record id="email_template_2" model="email.template">
|
||||
@@ -50,11 +53,11 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello,We have very good offer that might suit you.
|
||||
We propose you to subscribe to the OpenERP Discovery Day on May 2010.
|
||||
If any further information required kindly revert back.
|
||||
We really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>We have very good offer that might suit you.
|
||||
We suggest you subscribe to the OpenERP Discovery Day on May 2010.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">For OpenERP Discovery Day on May 2010</field>
|
||||
</record>
|
||||
|
||||
@@ -65,10 +68,10 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello,Thanks for showing intrest and for subscribing to the OpenERP Discovery Day.
|
||||
If any further information required kindly revert back.
|
||||
I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>Thanks for showing interest and for subscribing to the OpenERP Discovery Day.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">For OpenERP Discovery Day</field>
|
||||
</record>
|
||||
|
||||
@@ -79,10 +82,10 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello,Thanks for showing intrest and buying the OpenERP book.
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>Thanks for showing interest and buying the OpenERP book.</p>
|
||||
If any further information required kindly revert back.
|
||||
I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">For OpenERP book</field>
|
||||
</record>
|
||||
|
||||
@@ -92,12 +95,12 @@
|
||||
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello, We have very good offer that might suit you.
|
||||
For our gold partners,We are arranging free technical training on june,2010.
|
||||
If any further information required kindly revert back.
|
||||
I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="name">For technical training to Gold partners</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>We have very good offer that might suit you.
|
||||
For our gold partners,We are arranging free technical training on june,2010.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">technical training to gold partners</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_6" model="email.template">
|
||||
@@ -107,12 +110,12 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello, We have very good offer that might suit you.
|
||||
For our silver partners,We are paid technical training on june,2010.
|
||||
If any further information required kindly revert back.
|
||||
I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="name">For training to Silver partners</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>We have very good offer that might suit you.
|
||||
For our silver partners,We are paid technical training on june,2010.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">training to silver partners</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_7" model="email.template">
|
||||
@@ -122,12 +125,12 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello, We have very good offer that might suit you.
|
||||
For our silver partners,We are offering Gold partnership.
|
||||
If any further information required kindly revert back.
|
||||
I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="name">For gold partnership to silver partners</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>We have very good offer that might suit you.
|
||||
For our silver partners, we are offering Gold partnership.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">gold partnership to silver partners</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_8" model="email.template">
|
||||
@@ -137,9 +140,12 @@
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body">Hello, Thanks for showing intrest and for subscribing to technical training.If any further information required kindly revert back.I really appreciate your co-operation on this.
|
||||
Regards,OpenERP Team,</field>
|
||||
<field name="name">For subscribing to technical training</field>
|
||||
<field name="body_html"><![CDATA[<p>Hello,</p>
|
||||
<p>Thanks for showing interest and for subscribing to technical training.</p>
|
||||
If any further information required kindly revert back.I really appreciate your co-operation on this.</p>
|
||||
<p>If any further information is required, do not hesitate to reply to this message.</p>
|
||||
<p>Regards,OpenERP Team,</p>]]></field>
|
||||
<field name="name">subscribing to technical training</field>
|
||||
</record>
|
||||
<!-- Report -->
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ invoice and send propositions for membership renewal.
|
||||
'membership_view.xml',
|
||||
'report/report_membership_view.xml',
|
||||
'process/membership_process.xml',
|
||||
'membership_data.xml'
|
||||
],
|
||||
'demo': ['membership_demo.xml'],
|
||||
'test': ['test/test_membership.yml'],
|
||||
|
||||
@@ -146,7 +146,7 @@ class membership_line(osv.osv):
|
||||
'date_to': fields.date('To', readonly=True),
|
||||
'date_cancel': fields.date('Cancel date'),
|
||||
'date': fields.date('Join Date', help="Date on which member has joined the membership"),
|
||||
'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Product Price'), required=True, help='Amount for the membership'),
|
||||
'member_price': fields.float('Membership Fee', digits_compute= dp.get_precision('Product Price'), required=True, help='Amount for the membership'),
|
||||
'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True),
|
||||
'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True),
|
||||
'state': fields.function(_state,
|
||||
@@ -444,14 +444,6 @@ class Partner(osv.osv):
|
||||
|
||||
Partner()
|
||||
|
||||
class product_template(osv.osv):
|
||||
_inherit = 'product.template'
|
||||
_columns = {
|
||||
'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Product Price')),
|
||||
}
|
||||
|
||||
product_template()
|
||||
|
||||
class Product(osv.osv):
|
||||
|
||||
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!--
|
||||
Price type
|
||||
-->
|
||||
<record model="product.price.type" id="product_price_type_memberprice" >
|
||||
<field name="name">Member Price</field>
|
||||
<field name="field">member_price</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Price list
|
||||
-->
|
||||
<record model="product.pricelist" id="list1m">
|
||||
<field name="name">Member Sale Pricelist</field>
|
||||
<field name="type">sale</field>
|
||||
</record>
|
||||
<record model="product.pricelist.version" id="ver1m">
|
||||
<field name="pricelist_id" ref="list1m"/>
|
||||
<field name="name">Member Sale Pricelist Version</field>
|
||||
</record>
|
||||
<record model="product.pricelist.item" id="item1m">
|
||||
<field name="price_version_id" ref="ver1m"/>
|
||||
<field name="base" ref="product_price_type_memberprice" />
|
||||
<field name="name">Member Sale Pricelist Line</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -88,11 +88,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<page string="Information" position="after">
|
||||
<page string="Membership">
|
||||
<group>
|
||||
<group col="1">
|
||||
<group>
|
||||
<field name="membership" readonly="0"/>
|
||||
</group>
|
||||
<group>
|
||||
<group attrs="{'invisible':[('membership','=',False)]}">
|
||||
<field name="membership_date_from" readonly="0" attrs="{'required':[('membership','=',True)]}"/>
|
||||
<field name="membership_date_to" readonly="0" attrs="{'required':[('membership','=',True)]}"/>
|
||||
</group>
|
||||
@@ -270,17 +270,5 @@
|
||||
<!-- MEMBERSHIP/REPORTING -->
|
||||
<menuitem name="Reporting" id="base.menu_report_association" parent="base.menu_association" sequence="20"/>
|
||||
|
||||
<!-- View for product.product object inherited from product module -->
|
||||
<record model="ir.ui.view" id="view_product_form_inherit1">
|
||||
<field name="name">product.normal.form</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="list_price" position="after">
|
||||
<field name="member_price" groups="base.group_user"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+25
-32
@@ -501,7 +501,7 @@
|
||||
<field name="res_model">mrp.bom</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="mrp_bom_component_tree_view"/>
|
||||
<field name="domain">[('bom_id','!=',False)]</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add a component to a bill of material.
|
||||
@@ -524,6 +524,7 @@
|
||||
action="mrp_bom_form_action2"
|
||||
id="menu_mrp_bom_form_action2"
|
||||
parent="menu_mrp_configuration"
|
||||
groups="base.group_no_one"
|
||||
sequence="20"/>
|
||||
|
||||
<record id="action2" model="ir.actions.act_window">
|
||||
@@ -647,50 +648,42 @@
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,ready,in_production,done" statusbar_colors='{"picking_except":"red","confirmed":"blue"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
<label for="product_id" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','<>',False),('bom_ids.bom_id','=',False)]" class="oe_inline"/>
|
||||
</h1>
|
||||
<label for="product_qty" class="oe_edit_only"/>
|
||||
<h2>
|
||||
<field name="product_qty" class="oe_inline"/>
|
||||
<field name="product_uom" groups="product.group_uom" class="oe_inline"/>
|
||||
<button type="action"
|
||||
icon="terp-accessories-archiver+"
|
||||
name="%(mrp.action_change_production_qty)d"
|
||||
string="Change Qty" states="ready,confirmed" class="oe_inline"/>
|
||||
</h2>
|
||||
<div groups="mrp.group_mrp_routings">
|
||||
<label for="routing_id" class="oe_edit_only"/>
|
||||
<h2><field name="routing_id" class="oe_inline"/></h2>
|
||||
<div class="oe_title">
|
||||
<h1>Manufacturing Order <field name="name" class="oe_inline"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id)" domain="[('bom_ids','<>',False),('bom_ids.bom_id','=',False)]" class="oe_inline"/>
|
||||
<label for="product_qty"/>
|
||||
<div>
|
||||
<field name="product_qty" class="oe_inline"/>
|
||||
<field name="product_uom" groups="product.group_uom" class="oe_inline"/>
|
||||
<button type="action"
|
||||
icon="terp-accessories-archiver+"
|
||||
name="%(mrp.action_change_production_qty)d"
|
||||
string="(Update)" states="ready,confirmed" class="oe_edit_only oe_link"/>
|
||||
</div>
|
||||
<label for="product_uos_qty" groups="product.group_uos"/>
|
||||
<div groups="product.group_uos">
|
||||
<field name="product_uos_qty" class="oe_inline"/>
|
||||
<label string="-" attrs="{'invisible':[('product_uos','=',False)]}" class="oe_inline"/>
|
||||
<field name="product_uos" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="date_planned"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bom_id" domain="[('product_id','=',product_id)]" context="{'default_product_id': product_id}" on_change="bom_id_change(bom_id)"/>
|
||||
<field name="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
|
||||
<field name="user_id"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<group groups="stock.group_locations">
|
||||
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
|
||||
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Consumed Products">
|
||||
<group>
|
||||
<group>
|
||||
<field name="bom_id" domain="[('product_id','=',product_id)]" context="{'default_product_id': product_id}" on_change="bom_id_change(bom_id)"/>
|
||||
</group>
|
||||
<group groups="stock.group_locations">
|
||||
<field name="location_src_id" domain="[('usage','=','internal')]" on_change="location_id_change(location_src_id,location_dest_id)"/>
|
||||
<field name="location_dest_id" domain="[('usage','=','internal')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="Products to Consume">
|
||||
<field name="move_lines" domain="[('state','<>', ('done', 'cancel'))]" nolabel="1">
|
||||
|
||||
@@ -52,47 +52,12 @@
|
||||
|
||||
<!-- User -->
|
||||
|
||||
<record id="res_users_editor_demo" model="res.users">
|
||||
<field name="password">editor_demo</field>
|
||||
<field name="name">OpenERP Editor</field>
|
||||
<field name="login">editor_demo</field>
|
||||
<field name="company_id" ref="res_company_oerp_editor"/>
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_editor'))]"/>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_user'),ref('base.group_sale_manager'),ref('project.group_project_user'),ref('account.group_account_invoice')])]"/>
|
||||
<record id="base.user_root" model="res.users">
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_editor')),(4, ref('res_company_oerp_us')),(4, ref('res_company_oerp_be'))]"/>
|
||||
</record>
|
||||
<record id="res_users_sales_demo_us" model="res.users">
|
||||
<field name="password">sales_demo_us</field>
|
||||
<field name="name">OpenERP Salesman US</field>
|
||||
<field name="login">sales_demo_us</field>
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_us'))]"/>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_user'),ref('base.group_sale_manager'),ref('project.group_project_user'),ref('account.group_account_invoice')])]"/>
|
||||
<record id="base.user_demo" model="res.users">
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_us')),(4, ref('res_company_oerp_be')),(4, ref('res_company_odoo'))]"/>
|
||||
</record>
|
||||
<record id="res_users_sales_demo_be" model="res.users">
|
||||
<field name="password">sales_demo_be</field>
|
||||
<field name="name">OpenERP Salesman BE</field>
|
||||
<field name="login">sales_demo_be</field>
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_be'))]"/>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_user'),ref('base.group_sale_manager'),ref('project.group_project_user'),ref('account.group_account_invoice')])]"/>
|
||||
</record>
|
||||
<record id="res_users_sales_demo_in" model="res.users">
|
||||
<field name="password">sales_demo_in</field>
|
||||
<field name="name">OpenERP Salesman IN</field>
|
||||
<field name="login">sales_demo_in</field>
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
<field name="company_ids" eval="[(4, ref('res_company_oerp_in'))]"/>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_user'),ref('base.group_sale_manager'),ref('project.group_project_user'),ref('account.group_account_invoice')])]"/>
|
||||
</record>
|
||||
<record id="res_users_odoo_demo" model="res.users">
|
||||
<field name="password">odoo_demo</field>
|
||||
<field name="name">Odoo</field>
|
||||
<field name="login">odoo_demo</field>
|
||||
<field name="company_id" ref="res_company_odoo"/>
|
||||
<field name="company_ids" eval="[(4, ref('res_company_odoo'))]"/>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_user'),ref('base.group_sale_manager'),ref('project.group_project_user'),ref('account.group_account_invoice')])]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Resource: product.product
|
||||
|
||||
@@ -19,6 +19,5 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import project_mailgate
|
||||
import note
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -19,34 +19,45 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Tasks-Mail Integration',
|
||||
'version': '1.1',
|
||||
'author': 'OpenERP SA',
|
||||
'website': 'http://www.openerp.com',
|
||||
'category': 'Project Management',
|
||||
'images': ['images/project_mailgate_task.jpeg'],
|
||||
'depends': ['project', 'mail'],
|
||||
'name': 'Notes',
|
||||
'version': '0.1',
|
||||
'category': 'Tools',
|
||||
'description': """
|
||||
This module can automatically create Project Tasks based on incoming emails.
|
||||
============================================================================
|
||||
This module allows users to create their own notes inside OpenERP
|
||||
=================================================================
|
||||
|
||||
Allows creating tasks based on new emails arriving at a given mailbox,
|
||||
similarly to what the CRM application has for Leads/Opportunities.
|
||||
Use notes to write meeting minutes, organize ideas, organize personnal todo
|
||||
lists, etc. Each user manages his own personnal notes. Notes are available to
|
||||
their authors only, but they can share notes to others users so that several
|
||||
people can work on the same note in real time. It's very efficient to share
|
||||
meeting minutes.
|
||||
|
||||
There are two common alternatives to configure the mailbox integration:
|
||||
-----------------------------------------------------------------------
|
||||
* Install the ``fetchmail`` module and configure a new mailbox, then select
|
||||
``Project Tasks`` as the target for incoming emails.
|
||||
* Set it up manually on your mail server based on the 'mail gateway' script
|
||||
provided in the ``mail`` module - and connect it to the `project.task` model.
|
||||
""",
|
||||
'data': [],
|
||||
'demo': [],
|
||||
Notes can be found in the 'Home' menu.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'website': 'http://openerp.com',
|
||||
'summary': 'Sticky Notes, Collaborative',
|
||||
'depends': [
|
||||
'base_tools',
|
||||
'mail',
|
||||
'pad',
|
||||
],
|
||||
'data': [
|
||||
'security/note_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'note_data.xml',
|
||||
'note_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
'note_demo.xml',
|
||||
],
|
||||
'css': [
|
||||
'static/src/css/note.css',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
'certificate': '001075048780413258261',
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,90 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class note_stage(osv.osv):
|
||||
""" Category of Note """
|
||||
_name = "note.stage"
|
||||
_description = "Note Stage"
|
||||
_columns = {
|
||||
'name': fields.char('Category Name', size=64, required=True),
|
||||
'sequence': fields.integer('Sequence', help="Used to order the note stages"),
|
||||
'user_id': fields.many2one('res.users', 'Owner', help="Owner of the note stage.", required=True, readonly=True),
|
||||
'fold': fields.boolean('Folded'),
|
||||
}
|
||||
_order = 'sequence asc'
|
||||
_defaults = {
|
||||
'fold': 0,
|
||||
'user_id': lambda self, cr, uid, ctx: uid,
|
||||
'sequence' : 1,
|
||||
}
|
||||
|
||||
class note_note(osv.osv):
|
||||
""" Note """
|
||||
_name = 'note.note'
|
||||
_inherit = ['mail.thread','pad.common']
|
||||
_pad_fields = ['note_pad']
|
||||
_description = "Note"
|
||||
|
||||
def _get_note_first_line(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for note in self.browse(cr, uid, ids, context=context):
|
||||
res[note.id] = (note.note or '').strip().split('\n')[0]
|
||||
return res
|
||||
|
||||
def _get_default_stage_id(self,cr,uid,context=None):
|
||||
ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)])
|
||||
return ids and ids[0] or False
|
||||
|
||||
def _read_group_stage_ids(self, cr, uid, ids, domain, read_group_order=None, access_rights_uid=None, context=None):
|
||||
access_rights_uid = access_rights_uid or uid
|
||||
stage_obj = self.pool.get('note.stage')
|
||||
|
||||
# only show stage groups not folded and owned by user
|
||||
search_domain = [('fold', '=', False),('user_id', '=', uid)]
|
||||
|
||||
stage_ids = stage_obj._search(cr, uid, search_domain, order=self._order, access_rights_uid=access_rights_uid, context=context)
|
||||
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.function(_get_note_first_line, string='Note Summary', type="text", store=True),
|
||||
'note': fields.text('Pad Content'),
|
||||
'note_pad_url': fields.char('Pad Url', size=250),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'stage_id': fields.many2one('note.stage', 'Stage'),
|
||||
'active': fields.boolean('Active'),
|
||||
'color': fields.integer('Color Index'),
|
||||
# to be replaced by message_follower_ids
|
||||
'follower_ids': fields.many2many('res.users', 'mail_subscription', 'res_id', 'user_id', 'Followers')
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active' : 1,
|
||||
'stage_id' : _get_default_stage_id,
|
||||
'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context),
|
||||
}
|
||||
_order = 'sequence asc'
|
||||
_group_by_full = {
|
||||
'stage_id' : _read_group_stage_ids,
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="note.stage" id="note_stage_01">
|
||||
<field name="name">Todo today</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="user_id" eval="ref('base.user_root')"/>
|
||||
</record>
|
||||
|
||||
<record model="note.stage" id="note_stage_02">
|
||||
<field name="name">Todo later</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="user_id" eval="ref('base.user_root')"/>
|
||||
</record>
|
||||
|
||||
<record model="note.stage" id="note_stage_03">
|
||||
<field name="name">For Info</field>
|
||||
<field name="sequence">3</field>
|
||||
<field name="user_id" eval="ref('base.user_root')"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="note_1" model="note.note">
|
||||
<field name="note"><![CDATA[Buying list
|
||||
* coffee
|
||||
* fruits
|
||||
* ice cream
|
||||
* towels
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="color">2</field>
|
||||
</record>
|
||||
<record id="note_2" model="note.note">
|
||||
<field name="note"><![CDATA[Buying list
|
||||
* more coffee
|
||||
* tee
|
||||
* sugar
|
||||
* towels
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record id="note_3" model="note.note">
|
||||
<field name="note"><![CDATA[Idea to develop
|
||||
* Phasellus vel eros lorem, vel tristique risus.
|
||||
* Cras elementum risus ut massa bibendum ac sollicitudin quam feugiat.
|
||||
* Phasellus ullamcorper mauris quis lectus volutpat non dignissim elit lacinia.
|
||||
|
||||
Nulla vitae metus risus, nec placerat diam.
|
||||
Proin quis nunc sodales dolor tempus eleifend.
|
||||
Praesent iaculis libero ut orci egestas a dapibus libero ornare.
|
||||
|
||||
* Proin at nisl sit amet ante feugiat euismod nec at orci.
|
||||
* Nam aliquam massa id neque tincidunt eu pellentesque neque euismod.
|
||||
* Proin eget mi sit amet erat tempus pellentesque.
|
||||
|
||||
* Phasellus congue est lectus, vitae semper arcu.
|
||||
* Suspendisse sodales tortor ut odio volutpat fringilla.
|
||||
* Vestibulum mattis est quis risus dignissim sit amet faucibus nisl mattis.
|
||||
* Pellentesque ullamcorper neque neque, vitae rhoncus massa.
|
||||
|
||||
Ut id magna massa, quis scelerisque sapien.
|
||||
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record id="note_4" model="note.note">
|
||||
<field name="note"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record id="note_5" model="note.note">
|
||||
<field name="note"><![CDATA[New computer specs
|
||||
* Motherboard
|
||||
according to processor
|
||||
* Processor
|
||||
need to decide
|
||||
* Graphic card
|
||||
with great performance for games !
|
||||
* Hard drive
|
||||
big, for lot of internet backups
|
||||
* Tower
|
||||
silent, better when watching films
|
||||
* Blueray drive ?
|
||||
is it interesting yet ?
|
||||
* Screen
|
||||
a big one, full of pixels, of course !
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="color">3</field>
|
||||
</record>
|
||||
|
||||
<record id="note_6" model="note.note">
|
||||
<field name="note"><![CDATA[Read those books
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record id="note_7" model="note.note">
|
||||
<field name="note"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<record id="note_8" model="note.note">
|
||||
<field name="note"><![CDATA[Read those books
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="color">5</field>
|
||||
</record>
|
||||
|
||||
<record id="note_9" model="note.note">
|
||||
<field name="note"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="color">7</field>
|
||||
</record>
|
||||
|
||||
<record id="note_10" model="note.note">
|
||||
<field name="note"><![CDATA[Read those books
|
||||
* Open ERP Version 6: a modern approach to integrated business management
|
||||
* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="note_pad"></field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem name="Organizer" id="note_my_stuff" parent="mail.mail_feeds_main"/>
|
||||
|
||||
<!-- Note Stage Form View -->
|
||||
<record model="ir.ui.view" id="view_note_stage_form">
|
||||
<field name="name">note.stage.form</field>
|
||||
<field name="model">note.stage</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stage of Notes" version="7.0">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Note Stage Tree View -->
|
||||
<record model="ir.ui.view" id="view_note_stage_tree">
|
||||
<field name="name">note.stage.tree</field>
|
||||
<field name="model">note.stage</field>
|
||||
<field name="field_parent"></field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Stages of notes" editable="bottom">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name"/>
|
||||
<field name="fold"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Note Stage Action -->
|
||||
<record model="ir.actions.act_window" id="action_note_stage">
|
||||
<field name="name">Stages</field>
|
||||
<field name="res_model">note.stage</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Categories"
|
||||
id="menu_notes_stage" parent="note_my_stuff" action="action_note_stage" sequence="40" groups="base.group_no_one"/>
|
||||
|
||||
<!-- New Note Kanban View -->
|
||||
<record model="ir.ui.view" id="view_note_note_kanban">
|
||||
<field name="name">note.note.kanban</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban default_group_by="stage_id" class="oe_notes" version="7.0">
|
||||
<field name="color"/>
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="active"/>
|
||||
<field name="note"/>
|
||||
<field name="follower_ids"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
|
||||
<!-- dropdown menu -->
|
||||
<div class="oe_dropdown_toggle oe_dropdown_kanban">
|
||||
<span class="oe_e">í</span>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<li><a type="edit">Edit...</a></li>
|
||||
<li><a type="delete">Delete</a></li>
|
||||
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- kanban note -->
|
||||
<div class="oe_kanban_content">
|
||||
<!-- title -->
|
||||
<field name="name"/>
|
||||
</div>
|
||||
|
||||
<div class="oe_kanban_project_avatars">
|
||||
<t t-foreach="record.follower_ids.raw_value" t-as="follower">
|
||||
<img t-att-src="kanban_image('res.users', 'image_small', follower)" t-att-data-member_id="follower"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_clear"></div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- New Note Form View -->
|
||||
<record model="ir.ui.view" id="view_note_note_form">
|
||||
<field name="name">note.note.form</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Note" version="7.0">
|
||||
<header>
|
||||
<field name="stage_id" domain="[('user_id','=',uid)]" widget="statusbar" clickable="1"/>
|
||||
</header>
|
||||
<field name="note"/>
|
||||
<field name="note_pad_url" invisible="1"/>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search Note -->
|
||||
<record model="ir.ui.view" id="view_note_note_filter">
|
||||
<field name="name">note.note.search</field>
|
||||
<field name="model">note.note</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Notes">
|
||||
<field name="note" string="Note"/>
|
||||
<field name="stage_id"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter icon="terp-personal" string="Creator" help="By Creators" context="{'group_by':'create_uid'}"/>
|
||||
<filter icon="terp-stock_symbol-selection" string="Stage" help="By Note Category" context="{'group_by':'stage_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Note Action -->
|
||||
<record model="ir.actions.act_window" id="action_note_note">
|
||||
<field name="name">Notes</field>
|
||||
<field name="res_model">note.note</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="search_view_id" ref="view_note_note_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Notes" id="note_notes" parent="note_my_stuff" sequence="20" action="action_note_note"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_note_stage_user,note.stage user,model_note_stage,base.group_user,1,1,1,1
|
||||
access_note_note_user,note.note user,model_note_note,base.group_user,1,1,1,1
|
||||
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="note_note_global" model="ir.rule">
|
||||
<field name="name">My notes</field>
|
||||
<field ref="model_note_note" name="model_id"/>
|
||||
<field eval="1" name="global"/>
|
||||
<field name="domain_force">[('follower_ids','=',user.id)]</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
note.css: note.sass
|
||||
sass -t expanded note.sass note.css
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
.openerp .oe_notes .oe_fold_column .oe_kanban_card {
|
||||
text-decoration:none;
|
||||
color:#000;
|
||||
display:block;
|
||||
padding:1em;
|
||||
margin-right: 1em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
-moz-box-shadow:5px 5px 7px rgba(33,33,33,1);
|
||||
-webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7);
|
||||
box-shadow: 5px 5px 7px rgba(33,33,33,.7);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_record .oe_kanban_card {
|
||||
-webkit-transform: rotate(-2deg);
|
||||
-o-transform: rotate(-2deg);
|
||||
-moz-transform:rotate(-2deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_record:nth-of-type(even) .oe_kanban_card {
|
||||
-webkit-transform: rotate(1deg);
|
||||
-o-transform: rotate(1deg);
|
||||
-moz-transform:rotate(1deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_record:nth-of-type(3n) .oe_kanban_card {
|
||||
-webkit-transform: rotate(4deg);
|
||||
-o-transform: rotate(4deg);
|
||||
-moz-transform:rotate(4deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record .oe_kanban_card {
|
||||
-webkit-transform: rotate(2deg);
|
||||
-o-transform: rotate(2deg);
|
||||
-moz-transform:rotate(2deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(even) .oe_kanban_card {
|
||||
-webkit-transform: rotate(-3deg);
|
||||
-o-transform: rotate(-3deg);
|
||||
-moz-transform:rotate(-3deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(even) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card {
|
||||
-webkit-transform: rotate(1deg);
|
||||
-o-transform: rotate(1deg);
|
||||
-moz-transform:rotate(1deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record .oe_kanban_card {
|
||||
-webkit-transform: rotate(-2deg);
|
||||
-o-transform: rotate(-2deg);
|
||||
-moz-transform:rotate(-2deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(even) .oe_kanban_card {
|
||||
-webkit-transform: rotate(1deg);
|
||||
-o-transform: rotate(1deg);
|
||||
-moz-transform:rotate(1deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column:nth-of-type(3n) .oe_kanban_record:nth-of-type(3n) .oe_kanban_card {
|
||||
-webkit-transform: rotate(-1deg);
|
||||
-o-transform: rotate(-1deg);
|
||||
-moz-transform:rotate(-1deg);
|
||||
}
|
||||
|
||||
.openerp .oe_notes .oe_kanban_column .oe_fold_column .oe_kanban_card:hover,
|
||||
.openerp .oe_notes .oe_kanban_column .oe_fold_column .oe_kanban_card:focus {
|
||||
box-shadow:10px 10px 7px rgba(0,0,0,.7);
|
||||
-moz-box-shadow:10px 10px 7px rgba(0,0,0,.7);
|
||||
-webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7);
|
||||
-webkit-transform: rotate(0);
|
||||
-moz-transform: rotate(0);
|
||||
-o-transform: rotate(0);
|
||||
position:relative;
|
||||
z-index:5;
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
@charset "utf-8"
|
||||
|
||||
// Variables {{{
|
||||
$section-title-color: #8786b7
|
||||
$tag-bg-light: #f0f0fa
|
||||
$tag-bg-dark: #8786b7
|
||||
$tag-border: #afafb6
|
||||
$tag-border-selected: #a6a6fe
|
||||
$hover-background: #f0f0fa
|
||||
$link-color: #8a89ba
|
||||
$sheet-max-width: 860px
|
||||
// }}}
|
||||
// Mixins {{{
|
||||
@font-face
|
||||
font-family: 'mnmliconsRegular'
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.eot') format('eot')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.woff') format('woff')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.ttf') format('truetype')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.svg') format('svg') active
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
|
||||
@font-face
|
||||
font-family: 'EntypoRegular'
|
||||
src: url('/web/static/src/font/entypo-webfont.eot') format('eot')
|
||||
src: url('/web/static/src/font/entypo-webfont.eot?#iefix') format('embedded-opentype')
|
||||
src: url('/web/static/src/font/entypo-webfont.woff') format('woff')
|
||||
src: url('/web/static/src/font/entypo-webfont.ttf') format('truetype')
|
||||
src: url('/web/static/src/font/entypo-webfont.svg') format('svg') active
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
|
||||
@mixin reset()
|
||||
border: none
|
||||
padding: 0
|
||||
margin: 0
|
||||
background: none
|
||||
@include radius(none)
|
||||
@include box-shadow(none)
|
||||
|
||||
@mixin vertical-gradient($startColor: #555, $endColor: #333)
|
||||
background-color: $startColor
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */
|
||||
background-image: -webkit-linear-gradient(top, $startColor, $endColor) /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||
background-image: -moz-linear-gradient(top, $startColor, $endColor) /* FF3.6 */
|
||||
background-image: -ms-linear-gradient(top, $startColor, $endColor) /* IE10 */
|
||||
background-image: -o-linear-gradient(top, $startColor, $endColor) /* Opera 11.10+ */
|
||||
background-image: linear-gradient(to bottom, $startColor, $endColor)
|
||||
|
||||
@mixin radial-gradient($gradient)
|
||||
background-position: center center
|
||||
background-image: -webkit-radial-gradient(circle, $gradient)
|
||||
background-image: -moz-radial-gradient($gradient)
|
||||
background-image: -ms-radial-gradient($gradient)
|
||||
background-image: radial-gradient($gradient)
|
||||
|
||||
@mixin radius($radius: 5px)
|
||||
-moz-border-radius: $radius
|
||||
-webkit-border-radius: $radius
|
||||
border-radius: $radius
|
||||
|
||||
@mixin box-shadow($bsval: 0px 1px 4px #777)
|
||||
-moz-box-shadow: $bsval
|
||||
-webkit-box-shadow: $bsval
|
||||
box-shadow: $bsval
|
||||
|
||||
@mixin transition($transval: (border linear 0.2s, box-shadow linear 0.2s))
|
||||
-webkit-transition: $transval
|
||||
-moz-transition: $transval
|
||||
-ms-transition: $transval
|
||||
-o-transition: $transval
|
||||
transition: $transval
|
||||
|
||||
@mixin opacity($opacity: .5)
|
||||
filter: alpha(opacity=$opacity * 100)
|
||||
opacity: $opacity
|
||||
|
||||
@mixin background-clip($clip: padding-box)
|
||||
-webkit-background-clip: $clip
|
||||
-moz-background-clip: $clip
|
||||
background-clip: $clip
|
||||
|
||||
@mixin box-sizing($type: content)
|
||||
// type = border || content || padding
|
||||
-webkit-box-sizing: #{$type}-box
|
||||
-moz-box-sizing: #{$type}-box
|
||||
-ms-box-sizing: #{$type}-box
|
||||
box-sizing: #{$type}-box
|
||||
|
||||
// Transforms the (readable) text of an inline element into an mmlicons icon,
|
||||
// allows for actual readable text in-code (and in readers?) with iconic looks
|
||||
@mixin text-to-icon($icon-name, $color: #404040)
|
||||
font-size: 1px
|
||||
letter-spacing: -1px
|
||||
color: transparent
|
||||
&:before
|
||||
font: 21px "mnmliconsRegular"
|
||||
content: $icon-name
|
||||
color: $color
|
||||
|
||||
// }}}
|
||||
// CSS animation bounces {{{
|
||||
@-moz-keyframes bounce
|
||||
0%
|
||||
-moz-transform: scale(0)
|
||||
opacity: 0
|
||||
50%
|
||||
-moz-transform: scale(1.3)
|
||||
opacity: 0.4
|
||||
75%
|
||||
-moz-transform: scale(0.9)
|
||||
opacity: 0.7
|
||||
100%
|
||||
-moz-transform: scale(1)
|
||||
opacity: 1
|
||||
|
||||
@-webkit-keyframes bounce
|
||||
0%
|
||||
-webkit-transform: scale(0)
|
||||
opacity: 0
|
||||
50%
|
||||
-webkit-transform: scale(1.3)
|
||||
opacity: 0.4
|
||||
75%
|
||||
-webkit-transform: scale(0.9)
|
||||
opacity: 0.7
|
||||
100%
|
||||
-webkit-transform: scale(1)
|
||||
opacity: 1
|
||||
// }}}
|
||||
|
||||
|
||||
.oe_kanban_color_2
|
||||
background-color:red
|
||||
|
||||
// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -8,31 +8,32 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-06-22 08:03+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2012-09-03 22:22+0000\n"
|
||||
"Last-Translator: Nicolas JEUDY <njeudy@simplee.fr>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n"
|
||||
"X-Generator: Launchpad (build 15864)\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-04 04:52+0000\n"
|
||||
"X-Generator: Launchpad (build 15890)\n"
|
||||
|
||||
#. module: pad_project
|
||||
#: constraint:project.task:0
|
||||
msgid "Error ! Task end-date must be greater then task start-date"
|
||||
msgstr ""
|
||||
"Erreur ! la date de fin de la tâche doit être supérieure a celle de début"
|
||||
|
||||
#. module: pad_project
|
||||
#: model:ir.model,name:pad_project.model_project_task
|
||||
msgid "Task"
|
||||
msgstr ""
|
||||
msgstr "Tâche"
|
||||
|
||||
#. module: pad_project
|
||||
#: view:project.task:0
|
||||
msgid "Pad"
|
||||
msgstr ""
|
||||
msgstr "Pad"
|
||||
|
||||
#. module: pad_project
|
||||
#: constraint:project.task:0
|
||||
msgid "Error ! You cannot create recursive tasks."
|
||||
msgstr ""
|
||||
msgstr "Erreur ! Vous ne pouvez pas créer de tâches récursives."
|
||||
|
||||
@@ -92,7 +92,8 @@ Main features:
|
||||
'static/src/js/main.js',
|
||||
],
|
||||
'css': [
|
||||
'static/src/css/pos.css',
|
||||
'static/src/css/pos.css', # this is the default css with hover effects
|
||||
#'static/src/css/pos_nohover.css', # this css has no hover effects (for resistive touchscreens)
|
||||
'static/src/css/keyboard.css'
|
||||
],
|
||||
'qweb': ['static/src/xml/pos.xml'],
|
||||
|
||||
@@ -1242,7 +1242,7 @@ import io, StringIO
|
||||
class ean_wizard(osv.osv_memory):
|
||||
_name = 'pos.ean_wizard'
|
||||
_columns = {
|
||||
'ean13_pattern': fields.char('Ean13 Pattern', size=32, required=True, translate=True),
|
||||
'ean13_pattern': fields.char('Reference', size=32, required=True, translate=True),
|
||||
}
|
||||
def sanitize_ean13(self, cr, uid, ids, context):
|
||||
for r in self.browse(cr,uid,ids):
|
||||
@@ -1306,7 +1306,7 @@ class product_product(osv.osv):
|
||||
|
||||
def edit_ean(self, cr, uid, ids, context):
|
||||
return {
|
||||
'name': "Edit Ean",
|
||||
'name': _("Assign a Custom EAN"),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
|
||||
@@ -11,30 +11,14 @@
|
||||
<record id="account.cash_journal" model="account.journal">
|
||||
<field eval="True" name="journal_user"/>
|
||||
</record>
|
||||
<record id="base.user_jsmith" model="res.users">
|
||||
<field name="name">John Smith (Cashier)</field>
|
||||
<field name="login">jsmith</field>
|
||||
<record id="base.user_root" model="res.users">
|
||||
<field name="ean13">0410300000004</field>
|
||||
<field name="groups_id" eval="[(4,ref('group_pos_manager'))]"/>
|
||||
</record>
|
||||
<record id="base.user_jdoe" model="res.users">
|
||||
<field name="name">John Doe (Cashier)</field>
|
||||
<field name="login">jdoe</field>
|
||||
<record id="base.user_demo" model="res.users">
|
||||
<field name="ean13">0410400000003</field>
|
||||
<field name="groups_id" eval="[(4,ref('group_pos_manager'))]"/>
|
||||
</record>
|
||||
<record id="base.user_jbloggs" model="res.users">
|
||||
<field name="name">Joe Bloggs (Client)</field>
|
||||
<field name="login">jbloggs</field>
|
||||
<field name="ean13">0420100000005</field>
|
||||
<field name="groups_id" eval="[(4,ref('group_pos_user'))]"/>
|
||||
</record>
|
||||
<record id="base.user_bsoap" model="res.users">
|
||||
<field name="name">Bob Soap (Client)</field>
|
||||
<field name="login">bsoap</field>
|
||||
<field name="ean13">0420200000004</field>
|
||||
<field name="groups_id" eval="[(4,ref('group_pos_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record model="pos.config" id="pos_config_main">
|
||||
<field name="journal_ids" eval="[(6, 0, [ref('account.cash_journal'), ref('account.bank_journal')])]" />
|
||||
|
||||
@@ -608,35 +608,21 @@
|
||||
<field name="domain">[('date_order','like',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
|
||||
<record id="product_normal_form_pos_view" model="ir.ui.view">
|
||||
<field name="name">product.normal.pos.form.inherit</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="status" position="after">
|
||||
<group name="pos" string="Point of Sale">
|
||||
<field name="pos_categ_id"/>
|
||||
<field name="to_weight" />
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">product.normal.form.inherit</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="misc" position="after">
|
||||
<group name="pos" colspan="2" col="2">
|
||||
<separator string="Point of Sale" colspan="2"/>
|
||||
<group name="sale" position="inside">
|
||||
<group name="pos" string="Point of Sale">
|
||||
<field name="pos_categ_id"/>
|
||||
<field name="to_weight" />
|
||||
<field name="income_pdt"/>
|
||||
<field name="expense_pdt"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="ean13" position="after">
|
||||
<button name="edit_ean" type="object" string="Edit" />
|
||||
<button name="edit_ean" type="object" string="Set a Custom EAN" class="oe_link oe_edit_only"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -930,7 +916,7 @@
|
||||
</field>
|
||||
</group>
|
||||
|
||||
<div attrs="{'invisible': [('state', '=', 'closed')]}">
|
||||
<div attrs="{'invisible': [('state', '!=', 'closed')]}">
|
||||
<group class="oe_subtotal_footer oe_right">
|
||||
<field name="cash_register_balance_start" readonly="1" string="Opening Balance" class="oe_subtotal_footer_separator"/>
|
||||
<field name="cash_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions"/>
|
||||
@@ -947,7 +933,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<group class="oe_subtotal_footer oe_right" attrs="{'invisible' : [('state', 'in', ('opening_control', 'closed'))]}">
|
||||
<group class="oe_subtotal_footer oe_right" attrs="{'invisible' : [('state', '!=', 'closed')]}">
|
||||
<field name="cash_register_balance_end_real" class="oe_subtotal_footer_separator"/>
|
||||
<field name="cash_register_difference" class="oe_subtotal_footer_separator"/>
|
||||
</group>
|
||||
@@ -1070,9 +1056,17 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Ean13 Generator" version="7.0">
|
||||
<field name="ean13_pattern"/>
|
||||
<p class="oe_grey">
|
||||
Enter a reference for this product, it will be converted
|
||||
automatically to a valid EAN number.
|
||||
</p>
|
||||
<group>
|
||||
<field name="ean13_pattern" class="oe_inline"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="sanitize_ean13" type="object" string="Apply"/>
|
||||
<button name="sanitize_ean13" type="object" string="Apply" class="oe_highlight"/> or
|
||||
<button icon="gtk-stop" special="cancel"
|
||||
string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1072,12 +1072,14 @@
|
||||
-webkit-transition-timing-function: ease-out;
|
||||
}
|
||||
|
||||
.point-of-sale .pos-actionbar .button.disabled{
|
||||
color:#AAA;
|
||||
.point-of-sale .pos-actionbar .button.disabled *{
|
||||
opacity: 0.5;
|
||||
}
|
||||
.point-of-sale .pos-actionbar .button.disabled:hover{
|
||||
border: 1px solid #cacaca;
|
||||
border-radius: 4px;
|
||||
color: #555;
|
||||
cursor: default;
|
||||
|
||||
background: #e2e2e2;
|
||||
background: -webkit-linear-gradient(#f0f0f0, #e2e2e2);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,11 +47,12 @@ TODO AUG 20
|
||||
v supprimer l'écran
|
||||
v bloquer sur l'impression
|
||||
v L'impression est foireuse
|
||||
- description_sales
|
||||
|
||||
* CLIENT
|
||||
- create a new branch
|
||||
v create a new branch
|
||||
- Self-checkout welcome screen
|
||||
- removal of products for the root category
|
||||
~ removal of products for the root category
|
||||
- Terminal de payement
|
||||
- Code à barres
|
||||
- Vidanges
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user