[MERGE] Sync with trunk
bzr revid: odo@openerp.com-20121024090615-zuh7aub6fhcwhy82
This commit is contained in:
commit
88dcca513f
|
@ -1431,6 +1431,9 @@ class account_move(osv.osv):
|
|||
if 'line_id' in vals:
|
||||
c = context.copy()
|
||||
c['novalidate'] = True
|
||||
c['period_id'] = vals['period_id']
|
||||
c['journal_id'] = vals['journal_id']
|
||||
c['date'] = vals['date']
|
||||
result = super(account_move, self).create(cr, uid, vals, c)
|
||||
self.validate(cr, uid, [result], context)
|
||||
else:
|
||||
|
|
|
@ -185,6 +185,7 @@ class account_invoice(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Description', size=64, select=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'supplier_invoice_number': fields.char('Supplier Invoice Number', size=64, help="The reference of this invoice as provided by the supplier.", readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'type': fields.selection([
|
||||
('out_invoice','Customer Invoice'),
|
||||
('in_invoice','Supplier Invoice'),
|
||||
|
|
|
@ -143,13 +143,11 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Supplier Invoice" version="7.0">
|
||||
<header>
|
||||
<span groups="base.group_user">
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' />
|
||||
<button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="account.group_account_invoice"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid' groups="account.group_account_invoice"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" groups="account.group_account_invoice"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
</span>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</header>
|
||||
<sheet string="Supplier Invoice">
|
||||
|
@ -170,12 +168,15 @@
|
|||
context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
|
||||
domain="[('supplier', '=', True)]"/>
|
||||
<field name="fiscal_position" widget="selection"/>
|
||||
<field name="origin"/>
|
||||
<label for="reference_type"/>
|
||||
<div>
|
||||
<group>
|
||||
<field name="origin"/>
|
||||
<field name="supplier_invoice_number"/>
|
||||
</group>
|
||||
<label for="reference_type"/>
|
||||
<div>
|
||||
<field name="reference_type" class="oe_inline oe_edit_only"/>
|
||||
<field name="reference" class="oe_inline"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_invoice"/>
|
||||
|
@ -291,20 +292,18 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Invoice" version="7.0">
|
||||
<header>
|
||||
<span groups="base.group_user">
|
||||
<button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight"/>
|
||||
<button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight"/>
|
||||
<button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}"/>
|
||||
<button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}"/>
|
||||
<button name="invoice_open" states="draft" string="Validate" class="oe_highlight"/>
|
||||
<button name="invoice_open" states="proforma2" string="Validate"/>
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid'/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,open" string="Cancel" groups="base.group_no_one"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
|
||||
</span>
|
||||
<button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="action_invoice_sent" type="object" string="Send by Email" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
|
||||
<button name="invoice_print" string="Print Invoice" type="object" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" groups="base.group_user"/>
|
||||
<button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/>
|
||||
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
|
||||
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user"/>
|
||||
<button name="invoice_cancel" states="draft,proforma2,open" string="Cancel" groups="base.group_no_one"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/>
|
||||
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','<>','paid'), ('reconciled', '=', True)]}" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
|
||||
<!--button name="%(account_invoices)d" string="Print Invoice" type="action" states="open,paid,proforma,sale,proforma2"/-->
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
|
||||
</header>
|
||||
<sheet string="Invoice">
|
||||
|
@ -449,7 +448,7 @@
|
|||
<field name="model">account.invoice</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Invoice">
|
||||
<field name="number" string="Invoice" filter_domain="['|', ('number','ilike',self),('origin','ilike',self)]"/>
|
||||
<field name="number" string="Invoice" filter_domain="['|','|', ('number','ilike',self), ('origin','ilike',self), ('supplier_invoice_number', 'ilike', self)]"/>
|
||||
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
|
||||
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="account.group_proforma_invoices"/>
|
||||
<filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
|
||||
|
|
|
@ -1234,16 +1234,16 @@ class account_move_line(osv.osv):
|
|||
vals['company_id'] = company_id[0]
|
||||
if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']:
|
||||
raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.'))
|
||||
if 'journal_id' in vals:
|
||||
if 'journal_id' in vals and vals['journal_id']:
|
||||
context['journal_id'] = vals['journal_id']
|
||||
if 'period_id' in vals:
|
||||
if 'period_id' in vals and vals['period_id']:
|
||||
context['period_id'] = vals['period_id']
|
||||
if ('journal_id' not in context) and ('move_id' in vals) and vals['move_id']:
|
||||
m = move_obj.browse(cr, uid, vals['move_id'])
|
||||
context['journal_id'] = m.journal_id.id
|
||||
context['period_id'] = m.period_id.id
|
||||
#we need to treat the case where a value is given in the context for period_id as a string
|
||||
if 'period_id' not in context or not isinstance(context.get('period_id', ''), (int, long)):
|
||||
if 'period_id' in context and not isinstance(context.get('period_id', ''), (int, long)):
|
||||
period_candidate_ids = self.pool.get('account.period').name_search(cr, uid, name=context.get('period_id',''))
|
||||
if len(period_candidate_ids) != 1:
|
||||
raise osv.except_osv(_('Error!'), _('No period found or more than one period found for the given date.'))
|
||||
|
@ -1253,6 +1253,9 @@ class account_move_line(osv.osv):
|
|||
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
|
||||
move_id = vals.get('move_id', False)
|
||||
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)
|
||||
vals['journal_id'] = vals.get('journal_id') or context.get('journal_id')
|
||||
vals['period_id'] = vals.get('period_id') or context.get('period_id')
|
||||
vals['date'] = vals.get('date') or context.get('date')
|
||||
if not move_id:
|
||||
if journal.centralisation:
|
||||
#Check for centralisation
|
||||
|
|
|
@ -2414,32 +2414,6 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<record id="ir_actions_server_action_wizard_multi_chart" model="ir.actions.server">
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="condition">True</field>
|
||||
<field name="state">code</field>
|
||||
<field name="model_id" ref="base.model_ir_actions_todo"/>
|
||||
<field eval="5" name="sequence"/>
|
||||
<field name="code">
|
||||
# check for unconfigured companies
|
||||
account_installer_obj = self.pool.get('account.installer')
|
||||
account_installer_obj.check_unconfigured_cmp(cr, uid, context=context)
|
||||
action_ids = []
|
||||
# fetch the act_window actions related to chart of account configuration
|
||||
# we use ir.actions.todo to enable the possibility for other modules to insert their own
|
||||
# wizards during the configuration process
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_wizard_multi_chart')
|
||||
if ref:
|
||||
action_ids += [ref[1]]
|
||||
ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_account_configuration_installer')
|
||||
if ref:
|
||||
action_ids += [ref[1]]
|
||||
todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', action_ids)], context=context)
|
||||
pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
|
||||
action = pool.get('res.config').next(cr, uid, [], context)
|
||||
</field>
|
||||
<field name="name">New Company Financial Setting</field>
|
||||
</record>
|
||||
|
||||
<record id="account_account_graph" model="ir.ui.view">
|
||||
<field name="name">account.account.graph</field>
|
||||
|
|
|
@ -119,15 +119,6 @@ class account_installer(osv.osv_memory):
|
|||
self.execute_simple(cr, uid, ids, context)
|
||||
super(account_installer, self).execute(cr, uid, ids, context=context)
|
||||
|
||||
def action_next(self, cr, uid, ids, context=None):
|
||||
next = self.execute(cr, uid, ids, context=context)
|
||||
for installer in self.browse(cr, uid, ids, context=context):
|
||||
if installer.charts == 'l10n_be':
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
else :
|
||||
if next : return next
|
||||
return self.next(cr, uid, ids, context=context)
|
||||
|
||||
def execute_simple(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
</div>
|
||||
</group>
|
||||
<group string="Product Information">
|
||||
<field name="product_id"/>
|
||||
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
|
||||
<label for="unit_amount"/>
|
||||
<div>
|
||||
<field name="unit_amount" class="oe_inline"/>
|
||||
|
@ -160,7 +160,7 @@
|
|||
<field name="name">account.analytic.line.tree</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="top" string="Analytic Entries">
|
||||
<tree string="Analytic Entries">
|
||||
<field name="date"/>
|
||||
<field name="ref" invisible="context.get('to_invoice', False)"/>
|
||||
<field name="name"/>
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ o.title.name or '' ]] [[ o.name ]]</para>
|
||||
<para style="terp_default_9">[[ display_address(o.partner_id) ]]</para>
|
||||
<para style="terp_default_9">[[ display_address(o) ]]</para>
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
|
|
@ -11,7 +11,7 @@ openerp.account = function (instance) {
|
|||
this._super.apply(this, arguments);
|
||||
var self = this;
|
||||
this.current_partner = null;
|
||||
this.do_select.add(function() {
|
||||
this.on('record_selected', this, function() {
|
||||
if (self.get_selected_ids().length === 0) {
|
||||
self.$(".oe_account_recon_reconcile").attr("disabled", "");
|
||||
} else {
|
||||
|
@ -19,7 +19,7 @@ openerp.account = function (instance) {
|
|||
}
|
||||
});
|
||||
},
|
||||
on_loaded: function() {
|
||||
load_list: function() {
|
||||
var self = this;
|
||||
var tmp = this._super.apply(this, arguments);
|
||||
if (this.partners) {
|
||||
|
@ -102,7 +102,6 @@ openerp.account = function (instance) {
|
|||
action_id: result[1],
|
||||
context: additional_context
|
||||
}).then(function (result) {
|
||||
result = result.result;
|
||||
result.context = _.extend(result.context || {}, additional_context);
|
||||
result.flags = result.flags || {};
|
||||
result.flags.new_window = true;
|
||||
|
@ -121,6 +120,10 @@ openerp.account = function (instance) {
|
|||
self.do_search(self.last_domain, self.last_context, self.last_group_by);
|
||||
});
|
||||
},
|
||||
do_select: function (ids, records) {
|
||||
this.trigger('record_selected')
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
@ -11,21 +11,18 @@
|
|||
-
|
||||
!record {model: account.move, id: account_move_0}:
|
||||
date: !eval time.strftime('%Y-%m-%d')
|
||||
period_id: account.period_6
|
||||
journal_id: account.bank_journal
|
||||
line_id:
|
||||
- account_id: account.cash
|
||||
amount_currency: 0.0
|
||||
credit: 2000.0
|
||||
date: !eval time.strftime('%Y-%m-%d')
|
||||
debit: 0.0
|
||||
journal_id: account.bank_journal
|
||||
name: Basic Computer
|
||||
partner_id: base.res_partner_12
|
||||
period_id: account.period_6
|
||||
ref: '2011010'
|
||||
tax_amount: 0.0
|
||||
name: /
|
||||
period_id: account.period_6
|
||||
ref: '2011010'
|
||||
state: draft
|
||||
-
|
||||
|
@ -110,4 +107,4 @@
|
|||
partial_reconcile = self.trans_rec_reconcile_partial_reconcile(cr, uid, [ref('account_move_line_reconcile0')], {'lang': u'en_US',
|
||||
'active_model': 'account.move.line', 'active_ids': ids, 'tz': False, 'active_id': ids[0]})
|
||||
move_line = move_line_obj.browse(cr, uid, ids)
|
||||
assert move_line[0].reconcile_partial_id, "Partial reconcilation is not done"
|
||||
assert move_line[0].reconcile_partial_id, "Partial reconcilation is not done"
|
||||
|
|
|
@ -1,38 +1,23 @@
|
|||
# Spanish translation for openobject-addons
|
||||
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
|
||||
# Spanish (Mexico) 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>, 2010.
|
||||
# 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: 2011-01-11 11:14+0000\n"
|
||||
"PO-Revision-Date: 2010-11-23 09:43+0000\n"
|
||||
"Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
|
||||
"<jesteve@zikzakmedia.com>\n"
|
||||
"Language-Team: Spanish <es@li.org>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2012-10-22 17:44+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Spanish (Mexico) <es_MX@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: 2011-09-05 05:48+0000\n"
|
||||
"X-Generator: Launchpad (build 13830)\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-23 04:48+0000\n"
|
||||
"X-Generator: Launchpad (build 16179)\n"
|
||||
|
||||
#. module: account_cancel
|
||||
#: model:ir.module.module,description:account_cancel.module_meta_information
|
||||
msgid ""
|
||||
"\n"
|
||||
" Module adds 'Allow cancelling entries' field on form view of account "
|
||||
"journal. If set to true it allows user to cancel entries & invoices.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"\n"
|
||||
" Este módulo añade el campo 'Permitir la cancelación de asientos' en la "
|
||||
"vista de formulario de los diarios contables. Si está marcado, permite a los "
|
||||
"usuarios cancelar los asientos y las facturas.\n"
|
||||
" "
|
||||
|
||||
#. module: account_cancel
|
||||
#: model:ir.module.module,shortdesc:account_cancel.module_meta_information
|
||||
msgid "Account Cancel"
|
||||
msgstr "Cancelar asientos/facturas"
|
||||
#: view:account.invoice:0
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
|
|
@ -1422,7 +1422,7 @@ class account_voucher_line(osv.osv):
|
|||
}
|
||||
|
||||
def onchange_reconcile(self, cr, uid, ids, reconcile, amount, amount_unreconciled, context=None):
|
||||
vals = { 'amount': 0.0}
|
||||
vals = {'amount': 0.0}
|
||||
if reconcile:
|
||||
vals = { 'amount': amount_unreconciled}
|
||||
return {'value': vals}
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
account_id: account.cash
|
||||
amount: 1000.0
|
||||
company_id: base.main_company
|
||||
currency_id: base.EUR
|
||||
journal_id: account.bank_journal
|
||||
name: Voucher Axelor
|
||||
narration: PC Assemble SC234
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
'account_id': ref('account.cash'),
|
||||
'amount': 450.0,
|
||||
'company_id': ref('base.main_company'),
|
||||
'currency_id': ref('base.EUR'),
|
||||
'journal_id': ref('account.bank_journal'),
|
||||
'partner_id': ref('base.res_partner_19'),
|
||||
'period_id': ref('account.period_8'),
|
||||
|
@ -53,6 +52,10 @@
|
|||
}
|
||||
if not res['value']['line_cr_ids']:
|
||||
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
|
||||
#clients aren't sending value of readonly fields in the view, and there is a good reason for that, so here the
|
||||
#create should only use values of fields that are not readonly. That's why i'm removing some of these values
|
||||
del(res['value']['line_cr_ids'][0]['date_original'])
|
||||
del(res['value']['line_cr_ids'][0]['date_due'])
|
||||
res['value']['line_cr_ids'][0]['amount'] = 450.0
|
||||
vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
|
||||
id = self.create(cr, uid, vals)
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
'account_id': ref('account.cash'),
|
||||
'amount': 30000.0,
|
||||
'company_id': ref('base.main_company'),
|
||||
'currency_id': ref('base.EUR'),
|
||||
'journal_id': ref('account.bank_journal'),
|
||||
'partner_id': ref('base.res_partner_19'),
|
||||
'period_id': ref('account.period_8'),
|
||||
|
|
|
@ -255,27 +255,27 @@ class account_analytic_account(osv.osv):
|
|||
if context is None:
|
||||
context={}
|
||||
if context.get('current_model') == 'project.project':
|
||||
cr.execute("select analytic_account_id from project_project")
|
||||
project_ids = [x[0] for x in cr.fetchall()]
|
||||
project_obj = self.pool.get("account.analytic.account")
|
||||
project_ids = project_obj.search(cr, uid, args)
|
||||
return self.name_get(cr, uid, project_ids, context=context)
|
||||
if name:
|
||||
account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
|
||||
if not account:
|
||||
account_ids = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
|
||||
if not account_ids:
|
||||
names=map(lambda i : i.strip(),name.split('/'))
|
||||
for i in range(len(names)):
|
||||
dom=[('name', operator, names[i])]
|
||||
if i>0:
|
||||
dom+=[('id','child_of',account)]
|
||||
account = self.search(cr, uid, dom, limit=limit, context=context)
|
||||
newacc = account
|
||||
dom+=[('id','child_of',account_ids)]
|
||||
account_ids = self.search(cr, uid, dom, limit=limit, context=context)
|
||||
newacc = account_ids
|
||||
while newacc:
|
||||
newacc = self.search(cr, uid, [('parent_id', 'in', newacc)], limit=limit, context=context)
|
||||
account += newacc
|
||||
account_ids += newacc
|
||||
if args:
|
||||
account = self.search(cr, uid, [('id', 'in', account)] + args, limit=limit, context=context)
|
||||
account_ids = self.search(cr, uid, [('id', 'in', account_ids)] + args, limit=limit, context=context)
|
||||
else:
|
||||
account = self.search(cr, uid, args, limit=limit, context=context)
|
||||
return self.name_get(cr, uid, account, context=context)
|
||||
account_ids = self.search(cr, uid, args, limit=limit, context=context)
|
||||
return self.name_get(cr, uid, account_ids, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
contract = super(account_analytic_account, self).create(cr, uid, vals, context=context)
|
||||
|
|
|
@ -32,13 +32,23 @@ import datetime
|
|||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
from itertools import groupby
|
||||
from operator import itemgetter
|
||||
|
||||
|
||||
FIELD_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('not_existing', 'Not Existing')]
|
||||
ANONYMIZATION_STATES = FIELD_STATES + [('unstable', 'Unstable')]
|
||||
WIZARD_ANONYMIZATION_STATES = [('clear', 'Clear'), ('anonymized', 'Anonymized'), ('unstable', 'Unstable')]
|
||||
ANONYMIZATION_HISTORY_STATE = [('started', 'Started'), ('done', 'Done'), ('in_exception', 'Exception occured')]
|
||||
ANONYMIZATION_DIRECTION = [('clear -> anonymized', 'clear -> anonymized'), ('anonymized -> clear', 'anonymized -> clear')]
|
||||
|
||||
|
||||
def group(lst, cols):
|
||||
if isinstance(cols, basestring):
|
||||
cols = [cols]
|
||||
return dict((k, [v for v in itr]) for k, itr in groupby(sorted(lst, key=itemgetter(*cols)), itemgetter(*cols)))
|
||||
|
||||
|
||||
class ir_model_fields_anonymization(osv.osv):
|
||||
_name = 'ir.model.fields.anonymization'
|
||||
_rec_name = 'field_id'
|
||||
|
@ -207,8 +217,6 @@ class ir_model_fields_anonymization(osv.osv):
|
|||
'state': lambda *a: 'clear',
|
||||
}
|
||||
|
||||
ir_model_fields_anonymization()
|
||||
|
||||
|
||||
class ir_model_fields_anonymization_history(osv.osv):
|
||||
_name = 'ir.model.fields.anonymization.history'
|
||||
|
@ -223,8 +231,6 @@ class ir_model_fields_anonymization_history(osv.osv):
|
|||
'filepath': fields.char(string='File path', size=256, readonly=True),
|
||||
}
|
||||
|
||||
ir_model_fields_anonymization_history()
|
||||
|
||||
|
||||
class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
||||
_name = 'ir.model.fields.anonymize.wizard'
|
||||
|
@ -250,8 +256,8 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
'name': fields.char(size=64, string='File Name'),
|
||||
'summary': fields.function(_get_summary, type='text', string='Summary'),
|
||||
'file_export': fields.binary(string='Export'),
|
||||
'file_import': fields.binary(string='Import'),
|
||||
'state': fields.function(_get_state, string='Status', type='selection', selection=ANONYMIZATION_STATES, readonly=False),
|
||||
'file_import': fields.binary(string='Import', help="This is the file created by the anonymization process. It should have the '.pickle' extention."),
|
||||
'state': fields.function(_get_state, string='Status', type='selection', selection=WIZARD_ANONYMIZATION_STATES, readonly=False),
|
||||
'msg': fields.text(string='Message'),
|
||||
}
|
||||
|
||||
|
@ -319,6 +325,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
# clicked in the menu and the fields are already anonymized
|
||||
placeholder.addnext(etree.Element('newline'))
|
||||
placeholder.addnext(etree.Element('field', {'name': 'file_import', 'required': "1"}))
|
||||
placeholder.addnext(etree.Element('label', {'string': 'Anonymization file'}))
|
||||
eview.remove(placeholder)
|
||||
elif step == 'just_anonymized':
|
||||
# we just ran the anonymization process, we need the file export field
|
||||
|
@ -500,7 +507,6 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
|
||||
def reverse_anonymize_database(self, cr, uid, ids, context=None):
|
||||
"""Set the 'clear' state to defined fields"""
|
||||
|
||||
ir_model_fields_anonymization_model = self.pool.get('ir.model.fields.anonymization')
|
||||
anonymization_history_model = self.pool.get('ir.model.fields.anonymization.history')
|
||||
|
||||
|
@ -524,23 +530,46 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
wizards = self.browse(cr, uid, ids, context=context)
|
||||
for wizard in wizards:
|
||||
if not wizard.file_import:
|
||||
msg = "It is not possible to reverse the anonymization process without supplying anonymization export file."
|
||||
msg = "It is not possible to reverse the anonymization process without supplying the anonymization export file."
|
||||
self._raise_after_history_update(cr, uid, history_id, 'Error !', msg)
|
||||
|
||||
# reverse the anonymization:
|
||||
# load the pickle file content into a data structure:
|
||||
data = pickle.loads(base64.decodestring(wizard.file_import))
|
||||
|
||||
migration_fix_obj = self.pool.get('ir.model.fields.anonymization.migration.fix')
|
||||
fix_ids = migration_fix_obj.search(cr, uid, [('target_version', '=', '7.0')])
|
||||
fixes = migration_fix_obj.read(cr, uid, fix_ids, ['model_name', 'field_name', 'query', 'query_type', 'sequence'])
|
||||
fixes = group(fixes, ('model_name', 'field_name'))
|
||||
|
||||
for line in data:
|
||||
table_name = self.pool.get(line['model_id'])._table
|
||||
sql = "update %(table)s set %(field)s = %%(value)s where id = %%(id)s" % {
|
||||
'table': table_name,
|
||||
'field': line['field_id'],
|
||||
}
|
||||
cr.execute(sql, {
|
||||
'value': line['value'],
|
||||
'id': line['id']
|
||||
})
|
||||
|
||||
# check if custom sql exists:
|
||||
key = (line['model_id'], line['field_id'])
|
||||
custom_updates = fixes.get(key)
|
||||
if custom_updates:
|
||||
custom_updates.sort(itemgetter('sequence'))
|
||||
queries = [(record['query'], record['query_type']) for record in custom_updates if record['query_type']]
|
||||
else:
|
||||
queries = [("update %(table)s set %(field)s = %%(value)s where id = %%(id)s" % {
|
||||
'table': table_name,
|
||||
'field': line['field_id'],
|
||||
}, 'sql')]
|
||||
|
||||
for query in queries:
|
||||
if query[1] == 'sql':
|
||||
sql = query[0]
|
||||
cr.execute(sql, {
|
||||
'value': line['value'],
|
||||
'id': line['id']
|
||||
})
|
||||
elif query[1] == 'python':
|
||||
raw_code = query[0]
|
||||
code = raw_code % line
|
||||
eval(code)
|
||||
else:
|
||||
raise Exception("Unknown query type '%s'. Valid types are: sql, python." % (query['query_type'], ))
|
||||
|
||||
# update the anonymization fields:
|
||||
ir_model_fields_anonymization_model = self.pool.get('ir.model.fields.anonymization')
|
||||
|
@ -589,7 +618,19 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
res = None
|
||||
return res
|
||||
|
||||
ir_model_fields_anonymize_wizard()
|
||||
|
||||
class ir_model_fields_anonymization_migration_fix(osv.osv):
|
||||
_name = 'ir.model.fields.anonymization.migration.fix'
|
||||
_order = "sequence"
|
||||
|
||||
_columns = {
|
||||
'target_version': fields.char('Target Version'),
|
||||
'model_name': fields.char('Model'),
|
||||
'field_name': fields.char('Field'),
|
||||
'query': fields.text('Query'),
|
||||
'query_type': fields.selection(string='Query', selection=[('sql', 'sql'), ('python', 'python')]),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<field name="model_id" on_change="onchange_model_id(model_id)" />
|
||||
<field name="model_name" on_change="onchange_model_name(model_name)" />
|
||||
<field name="field_id"
|
||||
|
||||
on_change="onchange_field_id(field_id, model_name)"
|
||||
domain="[('model_id','=',model_id), ('ttype', 'not in', ['function', 'binary', 'many2many', 'many2one', 'one2many', 'reference'])]" />
|
||||
<field name="field_name" on_change="onchange_field_name(field_name, model_name)" />
|
||||
|
|
|
@ -0,0 +1,213 @@
|
|||
# Mongolian 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:35+0000\n"
|
||||
"PO-Revision-Date: 2012-10-22 02:35+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Mongolian <mn@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-10-23 04:48+0000\n"
|
||||
"X-Generator: Launchpad (build 16179)\n"
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.model,name:anonymization.model_ir_model_fields_anonymize_wizard
|
||||
msgid "ir.model.fields.anonymize.wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization,field_name:0
|
||||
msgid "Field Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization,field_id:0
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization.history,state:0
|
||||
#: field:ir.model.fields.anonymize.wizard,state:0
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymize.wizard,file_import:0
|
||||
msgid "Import"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.model,name:anonymization.model_ir_model_fields_anonymization
|
||||
msgid "ir.model.fields.anonymization"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization.history,direction:0
|
||||
msgid "Direction"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.actions.act_window,name:anonymization.action_ir_model_fields_anonymization_tree
|
||||
#: view:ir.model.fields.anonymization:0
|
||||
#: model:ir.ui.menu,name:anonymization.menu_administration_anonymization_fields
|
||||
msgid "Anonymized Fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.ui.menu,name:anonymization.menu_administration_anonymization
|
||||
msgid "Database anonymization"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization.history,direction:0
|
||||
msgid "clear -> anonymized"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization,state:0
|
||||
#: selection:ir.model.fields.anonymize.wizard,state:0
|
||||
msgid "Anonymized"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization,state:0
|
||||
msgid "unknown"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization,model_id:0
|
||||
msgid "Object"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization.history,filepath:0
|
||||
msgid "File path"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization.history,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymize.wizard,file_export:0
|
||||
msgid "Export"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymize.wizard:0
|
||||
msgid "Reverse the Database Anonymization"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymize.wizard:0
|
||||
msgid "Database Anonymization"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.ui.menu,name:anonymization.menu_administration_anonymization_wizard
|
||||
msgid "Anonymize database"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymization.history:0
|
||||
#: field:ir.model.fields.anonymization.history,field_ids:0
|
||||
msgid "Fields"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization,state:0
|
||||
#: selection:ir.model.fields.anonymize.wizard,state:0
|
||||
msgid "Clear"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymize.wizard:0
|
||||
#: field:ir.model.fields.anonymize.wizard,summary:0
|
||||
msgid "Summary"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymization:0
|
||||
msgid "Anonymized Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymize.wizard,state:0
|
||||
msgid "Unstable"
|
||||
msgstr "Тогтмол биш"
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization.history,state:0
|
||||
msgid "Exception occured"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization,state:0
|
||||
#: selection:ir.model.fields.anonymize.wizard,state:0
|
||||
msgid "Not Existing"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymization,model_name:0
|
||||
msgid "Object Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.actions.act_window,name:anonymization.action_ir_model_fields_anonymization_history_tree
|
||||
#: view:ir.model.fields.anonymization.history:0
|
||||
#: model:ir.ui.menu,name:anonymization.menu_administration_anonymization_history
|
||||
msgid "Anonymization History"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.model,name:anonymization.model_ir_model_fields_anonymization_history
|
||||
msgid "ir.model.fields.anonymization.history"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: model:ir.actions.act_window,name:anonymization.action_ir_model_fields_anonymize_wizard
|
||||
#: view:ir.model.fields.anonymize.wizard:0
|
||||
msgid "Anonymize Database"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: field:ir.model.fields.anonymize.wizard,name:0
|
||||
msgid "File Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization.history,direction:0
|
||||
msgid "anonymized -> clear"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization.history,state:0
|
||||
msgid "Started"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: selection:ir.model.fields.anonymization.history,state:0
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: view:ir.model.fields.anonymization.history:0
|
||||
#: field:ir.model.fields.anonymization.history,msg:0
|
||||
#: field:ir.model.fields.anonymize.wizard,msg:0
|
||||
msgid "Message"
|
||||
msgstr ""
|
||||
|
||||
#. module: anonymization
|
||||
#: code:addons/anonymization/anonymization.py:55
|
||||
#: sql_constraint:ir.model.fields.anonymization:0
|
||||
#, python-format
|
||||
msgid "You cannot have two fields with the same name on the same object!"
|
||||
msgstr ""
|
|
@ -19,15 +19,16 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv, orm
|
||||
from tools.translate import _
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
import re
|
||||
import time
|
||||
|
||||
from osv import fields, osv, orm
|
||||
from tools.translate import _
|
||||
from tools.safe_eval import safe_eval
|
||||
from tools import ustr
|
||||
import pooler
|
||||
import re
|
||||
import time
|
||||
import tools
|
||||
|
||||
|
||||
|
@ -48,32 +49,21 @@ class base_action_rule(osv.osv):
|
|||
_description = 'Action Rules'
|
||||
|
||||
def _state_get(self, cr, uid, context=None):
|
||||
""" Get State
|
||||
@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 context: A standard dictionary for contextual values """
|
||||
""" Get State """
|
||||
return self.state_get(cr, uid, context=context)
|
||||
|
||||
def state_get(self, cr, uid, context=None):
|
||||
""" Get State
|
||||
@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 context: A standard dictionary for contextual values """
|
||||
""" Get State """
|
||||
return [('', '')]
|
||||
|
||||
def priority_get(self, cr, uid, context=None):
|
||||
""" Get Priority
|
||||
@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 context: A standard dictionary for contextual values """
|
||||
""" Get Priority """
|
||||
return [('', '')]
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Rule Name', size=64, required=True),
|
||||
'model_id': fields.many2one('ir.model', 'Object', required=True),
|
||||
'model_id': fields.many2one('ir.model', 'Related Document Model', required=True, domain=[('osv_memory','=', False)]),
|
||||
'model': fields.related('model_id', 'model', type="char", size=256, string='Model'),
|
||||
'create_date': fields.datetime('Create Date', readonly=1),
|
||||
'active': fields.boolean('Active', help="If the active field is set to False,\
|
||||
it will allow you to hide the rule without removing it."),
|
||||
|
@ -82,6 +72,7 @@ when displaying a list of rules."),
|
|||
'trg_date_type': fields.selection([
|
||||
('none', 'None'),
|
||||
('create', 'Creation Date'),
|
||||
('write', 'Last Modified Date'),
|
||||
('action_last', 'Last Action Date'),
|
||||
('date', 'Date'),
|
||||
('deadline', 'Deadline'),
|
||||
|
@ -98,78 +89,39 @@ trigger date, like sending a reminder 15 minutes before a meeting."),
|
|||
'trg_state_from': fields.selection(_state_get, 'Status', size=16),
|
||||
'trg_state_to': fields.selection(_state_get, 'Button Pressed', size=16),
|
||||
|
||||
'act_method': fields.char('Call Object Method', size=64),
|
||||
'act_user_id': fields.many2one('res.users', 'Set Responsible to'),
|
||||
'act_state': fields.selection(_state_get, 'Set State to', size=16),
|
||||
'act_email_cc': fields.char('Add Watchers (Cc)', size=250, help="\
|
||||
These people will receive a copy of the future communication between partner \
|
||||
and users by email"),
|
||||
'act_remind_partner': fields.boolean('Remind Partner', help="Check \
|
||||
this if you want the rule to send a reminder by email to the partner."),
|
||||
'act_remind_user': fields.boolean('Remind Responsible', help="Check \
|
||||
this if you want the rule to send a reminder by email to the user."),
|
||||
'act_reply_to': fields.char('Reply-To', size=64),
|
||||
'act_remind_attach': fields.boolean('Remind with Attachment', help="Check this if you want that all documents attached to the object be attached to the reminder email sent."),
|
||||
'act_mail_to_user': fields.boolean('Mail to Responsible', help="Check\
|
||||
this if you want the rule to send an email to the responsible person."),
|
||||
'act_mail_to_watchers': fields.boolean('Mail to Watchers (CC)',
|
||||
help="Check this if you want \
|
||||
the rule to mark CC(mail to any other person defined in actions)."),
|
||||
'act_mail_to_email': fields.char('Mail to these Emails', size=128, \
|
||||
help="Email-id of the persons whom mail is to be sent"),
|
||||
'act_mail_body': fields.text('Mail body', help="Content of mail"),
|
||||
'act_followers': fields.many2many("res.partner", string="Set Followers"),
|
||||
'regex_name': fields.char('Regex on Resource Name', size=128, help="Regular expression for matching name of the resource\
|
||||
\ne.g.: 'urgent.*' will search for records having name starting with the string 'urgent'\
|
||||
\nNote: This is case sensitive search."),
|
||||
'server_action_id': fields.many2one('ir.actions.server', 'Server Action', help="Describes the action name.\neg:on which object which action to be taken on basis of which condition"),
|
||||
'filter_id':fields.many2one('ir.filters', 'Filter', required=False),
|
||||
'act_email_from' : fields.char('Email From', size=64, required=False,
|
||||
help="Use a python expression to specify the right field on which one than we will use for the 'From' field of the header"),
|
||||
'act_email_to' : fields.char('Email To', size=64, required=False,
|
||||
help="Use a python expression to specify the right field on which one than we will use for the 'To' field of the header"),
|
||||
'server_action_ids': fields.one2many('ir.actions.server', 'action_rule_id', 'Server Action', help="Define Server actions.\neg:Email Reminders, Call Object Service, etc.."), #TODO: set domain [('model_id','=',model_id)]
|
||||
'filter_id':fields.many2one('ir.filters', 'Filter', required=False), #TODO: set domain [('model_id','=',model_id.model)]
|
||||
'last_run': fields.datetime('Last Run', readonly=1),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a: True,
|
||||
'trg_date_type': lambda *a: 'none',
|
||||
'trg_date_range_type': lambda *a: 'day',
|
||||
'act_mail_to_user': lambda *a: 0,
|
||||
'act_remind_partner': lambda *a: 0,
|
||||
'act_remind_user': lambda *a: 0,
|
||||
'act_mail_to_watchers': lambda *a: 0,
|
||||
'active': True,
|
||||
'trg_date_type': 'none',
|
||||
'trg_date_range_type': 'day',
|
||||
}
|
||||
|
||||
_order = 'sequence'
|
||||
|
||||
def onchange_model_id(self, cr, uid, ids, name):
|
||||
#This is not a good solution as it will affect the domain only on onchange
|
||||
res = {'domain':{'filter_id':[]}}
|
||||
if name:
|
||||
model_name = self.pool.get('ir.model').read(cr, uid, [name], ['model'])
|
||||
if model_name:
|
||||
mod_name = model_name[0]['model']
|
||||
res['domain'] = {'filter_id': [('model_id','=',mod_name)]}
|
||||
else:
|
||||
res['value'] = {'filter_id':False}
|
||||
return res
|
||||
|
||||
def post_action(self, cr, uid, ids, model, context=None):
|
||||
# Searching for action rules
|
||||
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \
|
||||
LEFT JOIN ir_model model on (model.id = rule.model_id) \
|
||||
WHERE active")
|
||||
WHERE active and model = %s", (model,))
|
||||
res = cr.fetchall()
|
||||
# Check if any rule matching with current object
|
||||
for obj_name, rule_id in res:
|
||||
if not (model == obj_name):
|
||||
continue # TODO add this condition in the WHERE clause above.
|
||||
else:
|
||||
obj = self.pool.get(obj_name)
|
||||
# If the rule doesn't involve a time condition, run it immediately
|
||||
# Otherwise we let the scheduler run the action
|
||||
if self.browse(cr, uid, rule_id, context=context).trg_date_type == 'none':
|
||||
self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
|
||||
obj = self.pool.get(obj_name)
|
||||
# If the rule doesn't involve a time condition, run it immediately
|
||||
# Otherwise we let the scheduler run the action
|
||||
if self.browse(cr, uid, rule_id, context=context).trg_date_type == 'none':
|
||||
self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
|
||||
return True
|
||||
|
||||
def _create(self, old_create, model, context=None):
|
||||
|
@ -232,24 +184,30 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
|||
"""
|
||||
This Function is call by scheduler.
|
||||
"""
|
||||
rule_pool = self.pool.get('base.action.rule')
|
||||
rule_ids = rule_pool.search(cr, uid, [], context=context)
|
||||
rule_ids = self.search(cr, uid, [], context=context)
|
||||
self._register_hook(cr, uid, rule_ids, context=context)
|
||||
|
||||
rules = self.browse(cr, uid, rule_ids, context=context)
|
||||
for rule in rules:
|
||||
if context is None:
|
||||
context = {}
|
||||
for rule in self.browse(cr, uid, rule_ids, context=context):
|
||||
model = rule.model_id.model
|
||||
model_pool = self.pool.get(model)
|
||||
last_run = False
|
||||
if rule.last_run:
|
||||
last_run = get_datetime(rule.last_run)
|
||||
now = datetime.now()
|
||||
for obj_id in model_pool.search(cr, uid, [], context=context):
|
||||
obj = model_pool.browse(cr, uid, obj_id, context=context)
|
||||
ctx = dict(context)
|
||||
if rule.filter_id and rule.model_id.model == rule.filter_id.model_id:
|
||||
ctx.update(eval(rule.filter_id.context))
|
||||
obj_ids = model_pool.search(cr, uid, eval(rule.filter_id.domain), context=ctx)
|
||||
else:
|
||||
obj_ids = model_pool.search(cr, uid, [], context=ctx)
|
||||
for obj in model_pool.browse(cr, uid, obj_ids, context=ctx):
|
||||
# Calculate when this action should next occur for this object
|
||||
base = False
|
||||
if rule.trg_date_type=='create' and hasattr(obj, 'create_date'):
|
||||
base = obj.create_date
|
||||
elif rule.trg_date_type=='write' and hasattr(obj, 'write_date'):
|
||||
base = obj.write_date
|
||||
elif (rule.trg_date_type=='action_last'
|
||||
and hasattr(obj, 'create_date')):
|
||||
if hasattr(obj, 'date_action_last') and obj.date_action_last:
|
||||
|
@ -275,73 +233,25 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
|||
delay = fnct[rule.trg_date_range_type](rule.trg_date_range)
|
||||
action_date = base + delay
|
||||
if (not last_run or (last_run <= action_date < now)):
|
||||
self._action(cr, uid, [rule.id], [obj], context=context)
|
||||
rule_pool.write(cr, uid, [rule.id], {'last_run': now},
|
||||
context=context)
|
||||
|
||||
def format_body(self, body):
|
||||
""" Foramat Action rule's body
|
||||
@param self: The object pointer """
|
||||
return body and tools.ustr(body) or ''
|
||||
|
||||
def format_mail(self, obj, body):
|
||||
data = {
|
||||
'object_id': obj.id,
|
||||
'object_subject': hasattr(obj, 'name') and obj.name or False,
|
||||
'object_date': hasattr(obj, 'date') and obj.date or False,
|
||||
'object_description': hasattr(obj, 'description') and obj.description or False,
|
||||
'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/',
|
||||
'object_user_email': hasattr(obj, 'user_id') and (obj.user_id and \
|
||||
obj.user_id.email) or '/',
|
||||
'object_user_phone': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and \
|
||||
obj.partner_address_id.phone) or '/',
|
||||
'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/',
|
||||
'partner_email': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and\
|
||||
obj.partner_address_id.email) or '/',
|
||||
}
|
||||
return self.format_body(body % data)
|
||||
|
||||
def email_send(self, cr, uid, obj, emails, body, emailfrom=None, context=None):
|
||||
if not emailfrom:
|
||||
emailfrom = tools.config.get('email_from')
|
||||
body = self.format_mail(obj, body)
|
||||
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!'),
|
||||
_("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)
|
||||
|
||||
try:
|
||||
self._action(cr, uid, [rule.id], obj, context=ctx)
|
||||
self.write(cr, uid, [rule.id], {'last_run': now}, context=context)
|
||||
except Exception, e:
|
||||
import traceback
|
||||
print traceback.format_exc()
|
||||
|
||||
|
||||
|
||||
def do_check(self, cr, uid, action, obj, context=None):
|
||||
""" check Action
|
||||
@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 context: A standard dictionary for contextual values """
|
||||
""" check Action """
|
||||
if context is None:
|
||||
context = {}
|
||||
ok = True
|
||||
if action.filter_id:
|
||||
if action.model_id.model == action.filter_id.model_id:
|
||||
context.update(eval(action.filter_id.context))
|
||||
obj_ids = obj._table.search(cr, uid, eval(action.filter_id.domain), context=context)
|
||||
if not obj.id in obj_ids:
|
||||
ok = False
|
||||
else:
|
||||
ok = False
|
||||
if action.filter_id and action.model_id.model == action.filter_id.model_id:
|
||||
ctx = dict(context)
|
||||
ctx.update(eval(action.filter_id.context))
|
||||
obj_ids = self.pool.get(action.model_id.model).search(cr, uid, eval(action.filter_id.domain), context=ctx)
|
||||
ok = ok and obj.id in obj_ids
|
||||
if getattr(obj, 'user_id', False):
|
||||
ok = ok and (not action.trg_user_id.id or action.trg_user_id.id==obj.user_id.id)
|
||||
if getattr(obj, 'partner_id', False):
|
||||
|
@ -372,120 +282,62 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
|||
ok = ok and regex_n
|
||||
return ok
|
||||
|
||||
def do_action(self, cr, uid, action, model_obj, obj, context=None):
|
||||
""" Do Action
|
||||
@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 action: pass action
|
||||
@param model_obj: pass Model object
|
||||
@param context: A standard dictionary for contextual values """
|
||||
def do_action(self, cr, uid, action, obj, context=None):
|
||||
""" Do Action """
|
||||
if context is None:
|
||||
context = {}
|
||||
ctx = dict(context)
|
||||
model_obj = self.pool.get(action.model_id.model)
|
||||
action_server_obj = self.pool.get('ir.actions.server')
|
||||
if action.server_action_ids:
|
||||
ctx.update({'active_model': action.model_id.model, 'active_id':obj.id, 'active_ids':[obj.id]})
|
||||
action_server_obj.run(cr, uid, [x.id for x in action.server_action_ids], context=ctx)
|
||||
|
||||
if action.server_action_id:
|
||||
context.update({'active_id':obj.id, 'active_ids':[obj.id]})
|
||||
self.pool.get('ir.actions.server').run(cr, uid, [action.server_action_id.id], context)
|
||||
write = {}
|
||||
|
||||
if hasattr(obj, 'user_id') and action.act_user_id:
|
||||
obj.user_id = action.act_user_id
|
||||
write['user_id'] = action.act_user_id.id
|
||||
if hasattr(obj, 'date_action_last'):
|
||||
write['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if hasattr(obj, 'state') and action.act_state:
|
||||
obj.state = action.act_state
|
||||
write['state'] = action.act_state
|
||||
|
||||
if hasattr(obj, 'categ_id') and action.act_categ_id:
|
||||
obj.categ_id = action.act_categ_id
|
||||
write['categ_id'] = action.act_categ_id.id
|
||||
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
|
||||
if hasattr(model_obj, 'remind_user') and action.act_remind_user:
|
||||
model_obj.remind_user(cr, uid, [obj.id], context, attach=action.act_remind_attach)
|
||||
if hasattr(model_obj, 'remind_partner') and action.act_remind_partner:
|
||||
model_obj.remind_partner(cr, uid, [obj.id], context, attach=action.act_remind_attach)
|
||||
if action.act_method:
|
||||
getattr(model_obj, 'act_method')(cr, uid, [obj.id], action, context)
|
||||
|
||||
emails = []
|
||||
if hasattr(obj, 'user_id') and action.act_mail_to_user:
|
||||
if obj.user_id:
|
||||
emails.append(obj.user_id.email)
|
||||
|
||||
if action.act_mail_to_watchers:
|
||||
emails += (action.act_email_cc or '').split(',')
|
||||
if action.act_mail_to_email:
|
||||
emails += (action.act_mail_to_email or '').split(',')
|
||||
|
||||
locals_for_emails = {
|
||||
'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context),
|
||||
'obj' : obj,
|
||||
}
|
||||
|
||||
if action.act_email_to:
|
||||
emails.append(safe_eval(action.act_email_to, {}, locals_for_emails))
|
||||
|
||||
emails = filter(None, emails)
|
||||
if len(emails) and action.act_mail_body:
|
||||
emails = list(set(emails))
|
||||
email_from = safe_eval(action.act_email_from, {}, locals_for_emails)
|
||||
emails = tools.email_split(','.join(filter(None, emails)))
|
||||
email_froms = tools.email_split(email_from)
|
||||
if email_froms:
|
||||
self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_froms[0])
|
||||
if hasattr(obj, 'state') and hasattr(obj, 'message_post') and action.act_state:
|
||||
model_obj.message_post(cr, uid, [obj], _(action.act_state), context=context)
|
||||
|
||||
if hasattr(obj, 'message_subscribe') and action.act_followers:
|
||||
exits_followers = [x.id for x in obj.message_follower_ids]
|
||||
new_followers = [x.id for x in action.act_followers if x.id not in exits_followers]
|
||||
if new_followers:
|
||||
model_obj.message_subscribe(cr, uid, [obj.id], new_followers, context=context)
|
||||
return True
|
||||
|
||||
def _action(self, cr, uid, ids, objects, scrit=None, context=None):
|
||||
""" Do Action
|
||||
@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 ids: List of Basic Action Rule’s IDs,
|
||||
@param objects: pass objects
|
||||
@param context: A standard dictionary for contextual values """
|
||||
""" Do Action """
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
context.update({'action': True})
|
||||
if not scrit:
|
||||
scrit = []
|
||||
|
||||
if not isinstance(objects, list):
|
||||
objects = [objects]
|
||||
for action in self.browse(cr, uid, ids, context=context):
|
||||
for obj in objects:
|
||||
if self.do_check(cr, uid, action, obj, context=context):
|
||||
model_obj = self.pool.get(action.model_id.model)
|
||||
self.do_action(cr, uid, action, model_obj, obj, context=context)
|
||||
self.do_action(cr, uid, action, obj, context=context)
|
||||
|
||||
context.update({'action': False})
|
||||
return True
|
||||
|
||||
def _check_mail(self, cr, uid, ids, context=None):
|
||||
""" Check Mail
|
||||
@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 ids: List of Action Rule’s IDs
|
||||
@param context: A standard dictionary for contextual values """
|
||||
|
||||
empty = orm.browse_null()
|
||||
rule_obj = self.pool.get('base.action.rule')
|
||||
for rule in self.browse(cr, uid, ids, context=context):
|
||||
if rule.act_mail_body:
|
||||
try:
|
||||
rule_obj.format_mail(empty, rule.act_mail_body)
|
||||
except (ValueError, KeyError, TypeError):
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [
|
||||
(_check_mail, 'Error ! The mail is not well formated.', ['act_mail_body']),
|
||||
]
|
||||
|
||||
base_action_rule()
|
||||
|
||||
class actions_server(osv.osv):
|
||||
_inherit = 'ir.actions.server'
|
||||
_columns = {
|
||||
'action_rule_id': fields.many2one("base.action.rule", string="Action Rule")
|
||||
}
|
||||
actions_server()
|
||||
|
||||
class ir_cron(osv.osv):
|
||||
_inherit = 'ir.cron'
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
<sheet>
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="model_id" on_change="onchange_model_id(model_id)"/>
|
||||
<field name="filter_id" />
|
||||
<field name="model_id"/>
|
||||
<field name="model" invisible="1"/>
|
||||
<field name="filter_id" domain="[('model_id','=',model)]" context="{'default_model_id': model}"/>
|
||||
<field name="sequence"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
|
@ -31,62 +32,40 @@
|
|||
<field name="trg_partner_id"/>
|
||||
<field name="trg_partner_categ_id"/>
|
||||
</group>
|
||||
<group string="Conditions on States">
|
||||
<group name="state" string="Conditions on Status">
|
||||
<field name="trg_state_from"/>
|
||||
<field name="trg_state_to"/>
|
||||
</group>
|
||||
<group string="Conditions on Timing">
|
||||
<group name="timing" string="Conditions on Timing">
|
||||
<field name="trg_date_type"/>
|
||||
<group attrs="{'invisible': [('trg_date_type', '=', 'none')]}">
|
||||
<field name="trg_date_range" string="Delay After Trigger Date"/>
|
||||
<field name="trg_date_range_type"/>
|
||||
</group>
|
||||
<field name="trg_date_range" string="Delay After Trigger Date" attrs="{'invisible': [('trg_date_type', '=', 'none')]}"/>
|
||||
<field name="trg_date_range_type" attrs="{'invisible': [('trg_date_type', '=', 'none')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="Note"/>
|
||||
<label string="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." />
|
||||
<group string="Note">
|
||||
<label string="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." />
|
||||
</group>
|
||||
</page>
|
||||
<page string="Actions">
|
||||
<group string="Fields to Change" col="4">
|
||||
<group name="action_followers">
|
||||
<field name="act_followers" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group name="action_field" col="4" string="Fields to Change">
|
||||
<field name="act_user_id"/>
|
||||
<field name="act_state"/>
|
||||
</group>
|
||||
<group col="2" string="Server Action to be Triggered">
|
||||
<field name="server_action_id"/>
|
||||
<group name="action_server" string="Server Actions to be Triggered (eg. Email Reminder, Call Object Method, etc...)" >
|
||||
<field name="server_action_ids" domain="[('model_id','=', model_id)]" nolabel="1" context="{'default_model_id': model_id}">
|
||||
<tree string="Server Actions">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Email Actions">
|
||||
<group col="4">
|
||||
<separator colspan="4" string="Email Reminders"/>
|
||||
<field name="act_remind_partner"/>
|
||||
<field name="act_remind_attach"/>
|
||||
<field name="act_remind_user"/>
|
||||
<group col="2" colspan="2" attrs="{'invisible': [('act_remind_user','=',False)]}">
|
||||
<field name="act_reply_to" attrs="{'required':[('act_remind_user','=',True)]}"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Email Information"/>
|
||||
<field name="act_email_from" />
|
||||
<field name="act_email_to" />
|
||||
<field name="act_mail_to_user"/>
|
||||
<field colspan="4" name="act_mail_to_email"/>
|
||||
<field name="act_mail_to_watchers"/>
|
||||
<field colspan="4" name="act_email_cc"/>
|
||||
<separator colspan="4" string="Email Body"/>
|
||||
<field colspan="4" name="act_mail_body" height="250"
|
||||
nolabel="1" attrs="{'required':[('act_remind_user','=',True)]}" />
|
||||
<separator colspan="4" string="Special Keywords to be Used in the Body"/>
|
||||
<label align="0.0" string="%%(object_id)s = Object ID" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_subject)s = Object subject" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_description)s = Object description" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_date)s = Creation date" colspan="2"/>
|
||||
<label align="0.0" string="%%(partner)s = Partner name" colspan="2"/>
|
||||
<label align="0.0" string="%%(partner_email)s = Partner Email" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user)s = Responsible name" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user_email)s = Responsible Email" colspan="2"/>
|
||||
<label align="0.0" string="%%(object_user_phone)s = Responsible phone" colspan="2"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -1,121 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Attendee form view -->
|
||||
<record id="base_calendar_attendee_form_view" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.form</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Invitation details" version="7.0">
|
||||
<header>
|
||||
<button name="do_tentative" states="needs-action,declined,accepted" string="Uncertain" type="object" class="oe_highlight"/>
|
||||
<button name="do_accept" string="Accept" states="needs-action,tentative,declined" type="object" class="oe_highlight"/>
|
||||
<button name="do_decline" string="Decline" states="needs-action,tentative,accepted" type="object" class="oe_highlight"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="tentative,needs-action,accepted" statusbar_colors='{"proforma":"blue"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
||||
<div class="oe_title">
|
||||
<label for="email" string="Invitation To" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="email" class="oe_inline"/>
|
||||
(<field name="language" class="oe_inline"/>)
|
||||
</h1>
|
||||
|
||||
<h2>
|
||||
From <field name="event_date" class="oe_inline"/>
|
||||
to <field name="event_end_date" class="oe_inline"/>
|
||||
</h2>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="sent_by_uid" string="Invitation From"/>
|
||||
<field name="user_id" string="Invited User"/>
|
||||
<field name="partner_id" string="Contact"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="cutype" string="Invitation Type"/>
|
||||
<field name="role" string="Role"/>
|
||||
<field name="rsvp"/>
|
||||
<field name="ref" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="Delegated From">
|
||||
<field name="parent_ids" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
<group string="Delegated To" >
|
||||
<field name="child_ids" readonly="1" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Attendee tree view -->
|
||||
<record id="base_calendar_attendee_tree_view" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.tree</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Invitation details">
|
||||
<field name="sent_by_uid" string="Invitation From"/>
|
||||
<field name="role" string="My Role"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="cutype" string="Invitation Type"/>
|
||||
<field name="state"/>
|
||||
<field name="rsvp" string="Required to Join"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Attendee search view -->
|
||||
<record id="base_calendar_attendee_search_view" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.search</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Invitations">
|
||||
<field name="email" string="Email"/>
|
||||
<field name="event_date"/>
|
||||
<filter icon="terp-gtk-jump-to-ltr" name="toreview" string="To Review" domain="[('state','=', 'needs-action')]" help="Invitations To Review"/>
|
||||
<filter icon="terp-check" string="Accepted" domain="[('state','=', 'accepted')]" help="Accepted Invitations"/>
|
||||
<filter icon="terp-dialog-close" string="Declined" domain="[('state','=', 'declined')]" help="Declined Invitations"/>
|
||||
<filter icon="gtk-sort-descending" string="Delegated" domain="[('state','=', 'delegated')]" help="Delegated Invitations"/>
|
||||
<field name="user_id" string="Responsible"/>
|
||||
<field name="cutype" string="Invitation type"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Contact" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type" domain="[]" context="{'group_by':'cutype'}"/>
|
||||
<filter string="Role" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'role'}"/>
|
||||
<filter string="Required Reply" icon="terp-mail-replied" domain="[]" context="{'group_by':'rsvp'}"/>
|
||||
<filter string="Status" icon="terp-stock_effects-object-colorize" help="Invitation Type"
|
||||
domain="[]" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_view_attendee_form" model="ir.actions.act_window">
|
||||
<field name="name">Event Invitations</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">calendar.attendee</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view"/>
|
||||
<field name="context">{'default_sent_by_uid': uid}</field>
|
||||
</record>
|
||||
|
||||
<!-- Calendar's menu -->
|
||||
<menuitem id="base.menu_calendar_configuration" name="Calendar"
|
||||
parent="base.menu_base_config" sequence="50" groups="base.group_no_one"/>
|
||||
|
||||
<!-- Invitation menu -->
|
||||
<menuitem id="menu_attendee_invitations"
|
||||
parent="base.menu_calendar_configuration"
|
||||
sequence="10" action="action_view_attendee_form"/>
|
||||
|
||||
<!-- Alarm form view -->
|
||||
<record id="res_alarm_form_view" model="ir.ui.view">
|
||||
<field name="name">res.alarm.form</field>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_meeting"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_meeting_read" model="ir.values">
|
||||
<field name="name">action_crm_meeting_read</field>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_meeting"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_meeting_unread" model="ir.values">
|
||||
<field name="name">action_crm_meeting_unread</field>
|
||||
|
|
|
@ -140,18 +140,20 @@ class users(osv.osv):
|
|||
# Add handlers for 'input_pw' field.
|
||||
|
||||
def set_pw(self, cr, uid, id, name, value, args, context):
|
||||
if not value:
|
||||
raise osv.except_osv(_('Error!'), _("You have to specify a password."))
|
||||
if value:
|
||||
obj = pooler.get_pool(cr.dbname).get('res.users')
|
||||
if not hasattr(obj, "_salt_cache"):
|
||||
obj._salt_cache = {}
|
||||
|
||||
obj = pooler.get_pool(cr.dbname).get('res.users')
|
||||
if not hasattr(obj, "_salt_cache"):
|
||||
obj._salt_cache = {}
|
||||
salt = obj._salt_cache[id] = gen_salt()
|
||||
encrypted = encrypt_md5(value, salt)
|
||||
|
||||
salt = obj._salt_cache[id] = gen_salt()
|
||||
encrypted = encrypt_md5(value, salt)
|
||||
else:
|
||||
#setting a password to '' is allowed. It can be used to inactivate the classic log-in of the user
|
||||
#while the access can still be granted by another login method (openid...)
|
||||
encrypted = ''
|
||||
cr.execute('update res_users set password=%s where id=%s',
|
||||
(encrypted.encode('utf-8'), int(id)))
|
||||
cr.commit()
|
||||
del value
|
||||
|
||||
def get_pw( self, cr, uid, ids, name, args, context ):
|
||||
|
|
|
@ -38,7 +38,7 @@ openerp.base_import = function (instance) {
|
|||
// if true, the 'Import', 'Export', etc... buttons will be shown
|
||||
instance.web.ListView.prototype.defaults.import_enabled = true;
|
||||
instance.web.ListView.include({
|
||||
on_loaded: function () {
|
||||
load_list: function () {
|
||||
var self = this;
|
||||
var add_button = false;
|
||||
if (!this.$buttons) {
|
||||
|
|
|
@ -302,50 +302,13 @@ class base_stage(object):
|
|||
rule_ids = rule_obj.search(cr, uid, [('model_id','=',model_ids[0])], context=context)
|
||||
return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context)
|
||||
|
||||
def remind_partner(self, cr, uid, ids, context=None, attach=False):
|
||||
return self.remind_user(cr, uid, ids, context, attach,
|
||||
destination=False)
|
||||
|
||||
def remind_user(self, cr, uid, ids, context=None, attach=False, destination=True):
|
||||
if hasattr(self, 'message_post'):
|
||||
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):
|
||||
""" Function called by the scheduler to process cases for date actions.
|
||||
Must be overriden by inheriting classes.
|
||||
"""
|
||||
return True
|
||||
|
||||
def format_body(self, body):
|
||||
return self.pool.get('base.action.rule').format_body(body)
|
||||
|
||||
def format_mail(self, obj, body):
|
||||
return self.pool.get('base.action.rule').format_mail(obj, body)
|
||||
|
||||
# ******************************
|
||||
# Notifications
|
||||
# ******************************
|
||||
|
|
|
@ -85,7 +85,6 @@ Dashboard for CRM will include:
|
|||
'crm_lead_view.xml',
|
||||
'crm_lead_menu.xml',
|
||||
|
||||
'crm_meeting_view.xml',
|
||||
'crm_meeting_menu.xml',
|
||||
'crm_meeting_shortcut_data.xml',
|
||||
|
||||
|
@ -107,6 +106,7 @@ Dashboard for CRM will include:
|
|||
'crm_demo.xml',
|
||||
'crm_lead_demo.xml',
|
||||
'crm_phonecall_demo.xml',
|
||||
'crm_action_rule_demo.xml',
|
||||
],
|
||||
'test': [
|
||||
'test/process/communication_with_customer.yml',
|
||||
|
|
|
@ -41,24 +41,15 @@ class base_action_rule(osv.osv):
|
|||
'regex_history' : fields.char('Regular Expression on Case History', size=128),
|
||||
'act_section_id': fields.many2one('crm.case.section', 'Set Team to'),
|
||||
'act_categ_id': fields.many2one('crm.case.categ', 'Set Category to'),
|
||||
'act_mail_to_partner': fields.boolean('Mail to Partner',
|
||||
help="Check this if you want the rule to send an email to the partner."),
|
||||
}
|
||||
|
||||
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context=None):
|
||||
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]
|
||||
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)
|
||||
|
||||
if hasattr(obj, 'section_id'):
|
||||
ok = ok and (not action.trg_section_id or action.trg_section_id.id == obj.section_id.id)
|
||||
if hasattr(obj, 'categ_id'):
|
||||
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id == obj.categ_id.id)
|
||||
if hasattr(obj, 'categ_ids'):
|
||||
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id in [x.id for x in obj.categ_ids])
|
||||
|
||||
#Cheking for history
|
||||
regex = action.regex_history
|
||||
|
@ -80,36 +71,18 @@ class base_action_rule(osv.osv):
|
|||
ok = ok and res_count
|
||||
return ok
|
||||
|
||||
def do_action(self, cr, uid, action, model_obj, obj, context=None):
|
||||
def do_action(self, cr, uid, action, obj, context=None):
|
||||
res = super(base_action_rule, self).do_action(cr, uid, action, obj, context=context)
|
||||
model_obj = self.pool.get(action.model_id.model)
|
||||
write = {}
|
||||
if hasattr(action, 'act_section_id') and action.act_section_id:
|
||||
obj.section_id = action.act_section_id
|
||||
write['section_id'] = action.act_section_id.id
|
||||
|
||||
if hasattr(obj, 'email_cc') and action.act_email_cc:
|
||||
if '@' in (obj.email_cc or ''):
|
||||
emails = obj.email_cc.split(",")
|
||||
if obj.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails:
|
||||
write['email_cc'] = obj.email_cc + ',' + obj.act_email_cc
|
||||
else:
|
||||
write['email_cc'] = obj.act_email_cc
|
||||
|
||||
# Put state change by rule in communication history
|
||||
if hasattr(obj, 'state') and hasattr(obj, 'message_post') and action.act_state:
|
||||
model_obj.message_post(cr, uid, [obj], _(action.act_state), context=context)
|
||||
if hasattr(action, 'act_categ_id') and action.act_categ_id:
|
||||
write['categ_ids'] = [4, action.act_categ_id.id]
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
super(base_action_rule, self).do_action(cr, uid, action, model_obj, obj, context=context)
|
||||
emails = []
|
||||
|
||||
if hasattr(obj, 'email_from') and action.act_mail_to_partner:
|
||||
emails.append(obj.email_from)
|
||||
emails = filter(None, emails)
|
||||
if len(emails) and action.act_mail_body:
|
||||
emails = list(set(emails))
|
||||
self.email_send(cr, uid, obj, emails, action.act_mail_body)
|
||||
return True
|
||||
|
||||
return res
|
||||
|
||||
def state_get(self, cr, uid, context=None):
|
||||
"""Gets available states for crm"""
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- email server actions -->
|
||||
<record id="action_email_reminder_lead" model="ir.actions.server">
|
||||
<field name="name">Reminder to User</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="state">email</field>
|
||||
<field name="email">object.user_id.email</field>
|
||||
<field name="subject">Reminder on Lead: [[object.id ]] [[object.partner_id and 'of ' +object.partner_id.name or '']]</field>
|
||||
<field name="message">Hello [[object.user_id.name]],
|
||||
can you check following lead, it's not open since 5 days ?
|
||||
|
||||
Lead: [[object.id ]]
|
||||
Description:
|
||||
|
||||
[[object.description]]
|
||||
|
||||
Thanks,
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_email_reminder_customer_lead" model="ir.actions.server">
|
||||
<field name="name">Reminder to Customer</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="type">ir.actions.server</field>
|
||||
<field name="state">email</field>
|
||||
<field name="email">object.email_from</field>
|
||||
<field name="subject">Reminder on Lead: [[object.id ]]</field>
|
||||
<field name="message">Hello [[object.partner_id and object.partner_id.name or '']],
|
||||
your following lead is not open since 5 days.
|
||||
|
||||
Lead: [[object.id ]]
|
||||
Description:
|
||||
|
||||
[[object.description]]
|
||||
|
||||
Thanks,
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="filter_draft_lead" model="ir.filters">
|
||||
<field name="name">Filter on leads which are draft.</field>
|
||||
<field name="model_id">crm.lead</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
</record>
|
||||
|
||||
<!-- automated actions -->
|
||||
<record id="rule_set_reminder_lead" model="base.action.rule">
|
||||
<field name="name">Set Auto Reminder on leads which are not open since 5 days.</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="sequence">1</field>
|
||||
<field name="filter_id" ref="filter_draft_lead"/>
|
||||
<field name="trg_date_type">create</field>
|
||||
<field name="trg_date_range">5</field>
|
||||
<field name="trg_date_range_type">day</field>
|
||||
<field name="server_action_ids" eval="[(6,0,[ref('action_email_reminder_customer_lead'), ref('action_email_reminder_lead')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="filter_usa_lead" model="ir.filters">
|
||||
<field name="name">Filter on leads which come from USA.</field>
|
||||
<field name="model_id">crm.lead</field>
|
||||
<field name="domain">[('country_id','=','United States')]</field>
|
||||
</record>
|
||||
|
||||
<record id="rule_set_followers_lead" model="base.action.rule">
|
||||
<field name="name">Set Auto Followers on leads which are urgent and come from USA.</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="sequence">2</field>
|
||||
<field name="regex_name">urgent.*</field>
|
||||
<field name="filter_id" ref="filter_usa_lead"/>
|
||||
<field name="act_followers" eval="[(6,0,[ref('base.res_partner_4'), ref('base.res_partner_5'), ref('base.res_partner_6')])]"/>
|
||||
<field name="act_user_id" ref="base.user_root"/>
|
||||
<field name="act_section_id" ref="section_sales_department"/>
|
||||
<field name="trg_date_type">create</field>
|
||||
<field name="trg_date_range">0</field>
|
||||
<field name="trg_date_range_type">minutes</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -7,53 +7,21 @@
|
|||
<field name="model">base.action.rule</field>
|
||||
<field name="inherit_id" ref="base_action_rule.view_base_action_rule_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="partner" position="after">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Condition on Communication History"/>
|
||||
<xpath expr="//group[@name='partner']" position="after">
|
||||
<group name="case" string="Conditions on Case Fields">
|
||||
<field name="trg_section_id" widget="selection"/>
|
||||
<field name="trg_categ_id"/>
|
||||
</group>
|
||||
<group name="communication" string="Conditions on Communication History">
|
||||
<field name="regex_history"/>
|
||||
<field name="trg_max_history"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_base_action_rule_line_form2" model="ir.ui.view">
|
||||
<field name="name">base.action.rule.form2.inherit</field>
|
||||
<field name="model">base.action.rule</field>
|
||||
<field name="inherit_id" ref="base_action_rule.view_base_action_rule_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="partner" position="after">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Condition Case Fields"/>
|
||||
<field name="trg_section_id" widget="selection"/>
|
||||
<field name="trg_categ_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_base_action_rule_line_form3" model="ir.ui.view">
|
||||
<field name="name">base.action.rule.form3.inherit</field>
|
||||
<field name="model">base.action.rule</field>
|
||||
<field name="inherit_id" ref="base_action_rule.view_base_action_rule_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="act_user_id" position="after">
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='act_user_id']" position="after">
|
||||
<field name="act_section_id"/>
|
||||
<field name="act_categ_id"/>
|
||||
</field>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_base_action_rule_line_form4" model="ir.ui.view">
|
||||
<field name="name">base.action.rule.form4.inherit</field>
|
||||
<field name="model">base.action.rule</field>
|
||||
<field name="inherit_id" ref="base_action_rule.view_base_action_rule_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="act_mail_to_user" position="after">
|
||||
<field name="act_mail_to_partner"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_lead_unread" model="ir.values">
|
||||
<field name="name">action_crm_lead_unread</field>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_lead_read" model="ir.values">
|
||||
<field name="name">action_crm_lead_read</field>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Calendar Attendee Form View -->
|
||||
<record id="attendee_form_view_inherit" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.form.inherit</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="inherit_id" ref="base_calendar.base_calendar_attendee_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="ref" position="after">
|
||||
<field name="categ_id" string="Event Type"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -123,7 +123,7 @@
|
|||
OpenERP allows you to easily define all the calls to be done
|
||||
by your sales team and follow up based on their summary.
|
||||
</p><p>
|
||||
You can use the import feature to massicely import a new list of
|
||||
You can use the import feature to massively import a new list of
|
||||
prospects to qualify.
|
||||
</p>
|
||||
</field>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_phonecall"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_phonecall_unread" model="ir.values">
|
||||
<field name="name">action_crm_phonecall_unread</field>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_crm_phonecall"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_crm_phonecall_read" model="ir.values">
|
||||
<field name="name">action_crm_phonecall_read</field>
|
||||
|
@ -70,19 +70,19 @@
|
|||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="user_id"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<field name="opportunity_id" invisible="1"/>
|
||||
<button string="Meeting"
|
||||
states="open,pending" icon="gtk-redo"
|
||||
name="action_make_meeting" type="object"/>
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
states="open,pending"
|
||||
icon="gtk-index"
|
||||
type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
|
||||
<button string="Meeting"
|
||||
states="open,pending" icon="gtk-redo"
|
||||
name="action_make_meeting" type="object"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="user_id"/>
|
||||
<field name="categ_id" invisible="1"/>
|
||||
<field name="create_date" invisible="1"/>
|
||||
<field name="opportunity_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<button name="case_open" string="Confirm" type="object"
|
||||
states="draft,pending" icon="gtk-go-forward"/>
|
||||
|
|
|
@ -87,7 +87,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
|
|||
if 'user_id' in fields:
|
||||
res.update({'user_id': phonecall.user_id and phonecall.user_id.id or False})
|
||||
if 'date' in fields:
|
||||
res.update({'date': phonecall.date})
|
||||
res.update({'date': False})
|
||||
if 'section_id' in fields:
|
||||
res.update({'section_id': phonecall.section_id and phonecall.section_id.id or False})
|
||||
if 'categ_id' in fields:
|
||||
|
|
|
@ -124,7 +124,8 @@ class crm_claim(base_stage, osv.osv):
|
|||
'date': fields.datetime.now,
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
|
||||
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
|
||||
'active': lambda *a: 1
|
||||
'active': lambda *a: 1,
|
||||
'stage_id':lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
|
||||
}
|
||||
|
||||
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
|
||||
|
|
|
@ -102,22 +102,20 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Claim" version="7.0">
|
||||
<header>
|
||||
<span groups="base.group_user">
|
||||
<button name="case_open" string="Open" type="object" class="oe_highlight"
|
||||
states="draft,pending" />
|
||||
<button name="case_close" string="Done" type="object" class="oe_highlight"
|
||||
states="open,pending"/>
|
||||
<button name="case_refuse" string="Refuse" type="object" class="oe_highlight"
|
||||
states="draft,open,pending"/>
|
||||
<button name="stage_previous" string="Previous Stage" type="object"
|
||||
states="open,pending" icon="gtk-go-back" attrs="{'invisible': [('stage_id','=', False)]}"/>
|
||||
<button name="stage_next" string="Next Stage" type="object"
|
||||
states="open,pending" icon="gtk-go-forward" attrs="{'invisible': [('stage_id','=', False)]}"/>
|
||||
<button name="case_reset" string="Reset to Draft" type="object"
|
||||
states="cancel,done"/>
|
||||
<button name="case_cancel" string="Cancel" type="object"
|
||||
states="draft,open,pending"/>
|
||||
</span>
|
||||
<button name="case_open" string="Open" type="object" class="oe_highlight"
|
||||
states="draft,pending" groups="base.group_user"/>
|
||||
<button name="case_close" string="Done" type="object" class="oe_highlight"
|
||||
states="open,pending" groups="base.group_user"/>
|
||||
<button name="case_refuse" string="Refuse" type="object" class="oe_highlight"
|
||||
states="draft,open,pending" groups="base.group_user"/>
|
||||
<button name="stage_previous" string="Previous Stage" type="object" groups="base.group_user"
|
||||
states="open,pending" icon="gtk-go-back" attrs="{'invisible': [('stage_id','=', False)]}"/>
|
||||
<button name="stage_next" string="Next Stage" type="object" groups="base.group_user"
|
||||
states="open,pending" icon="gtk-go-forward" attrs="{'invisible': [('stage_id','=', False)]}"/>
|
||||
<button name="case_reset" string="Reset to Draft" type="object" groups="base.group_user"
|
||||
states="cancel,done"/>
|
||||
<button name="case_cancel" string="Cancel" type="object" groups="base.group_user"
|
||||
states="draft,open,pending"/>
|
||||
<field name="stage_id" widget="statusbar"
|
||||
on_change="onchange_stage_id(stage_id)"/>
|
||||
</header>
|
||||
|
|
|
@ -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: 2011-03-16 00:04+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2012-10-24 04:51+0000\n"
|
||||
"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n"
|
||||
"Language-Team: Russian <ru@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-10-19 05:33+0000\n"
|
||||
"X-Generator: Launchpad (build 16165)\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
|
||||
"X-Generator: Launchpad (build 16179)\n"
|
||||
|
||||
#. module: crm_claim
|
||||
#: field:crm.claim.report,nbr:0
|
||||
|
@ -85,12 +85,12 @@ msgstr ""
|
|||
#: code:addons/crm_claim/crm_claim.py:132
|
||||
#, python-format
|
||||
msgid "The claim '%s' has been opened."
|
||||
msgstr ""
|
||||
msgstr "Претензия '%s' была открыта"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim:0
|
||||
msgid "Date Closed"
|
||||
msgstr ""
|
||||
msgstr "Дата закрытия"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
|
@ -151,12 +151,12 @@ msgstr "Ссылка"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
msgid "Date of claim"
|
||||
msgstr ""
|
||||
msgstr "Дата претензии"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim:0
|
||||
msgid "All pending Claims"
|
||||
msgstr ""
|
||||
msgstr "Все ожидающие претензии"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
|
@ -187,7 +187,7 @@ msgstr "Контрагент"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
msgid "Month of claim"
|
||||
msgstr ""
|
||||
msgstr "Месяц претензии"
|
||||
|
||||
#. module: crm_claim
|
||||
#: selection:crm.claim,type_action:0
|
||||
|
@ -227,7 +227,7 @@ msgstr "Отправить новое эл. письмо"
|
|||
#: selection:crm.claim,state:0
|
||||
#: view:crm.claim.report:0
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
msgstr "Новый"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim:0
|
||||
|
@ -254,7 +254,7 @@ msgstr "Следующее действие"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
msgid "My Sales Team(s)"
|
||||
msgstr ""
|
||||
msgstr "Мои отделы продаж"
|
||||
|
||||
#. module: crm_claim
|
||||
#: model:crm.case.stage,name:crm_claim.stage_claim3
|
||||
|
@ -321,7 +321,7 @@ msgstr "Контакт"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
msgid "Month-1"
|
||||
msgstr ""
|
||||
msgstr "Месяц-1"
|
||||
|
||||
#. module: crm_claim
|
||||
#: model:ir.actions.act_window,name:crm_claim.action_report_crm_claim
|
||||
|
@ -380,7 +380,7 @@ msgstr "Дата изменения"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
msgid "Year of claim"
|
||||
msgstr ""
|
||||
msgstr "Год претензи"
|
||||
|
||||
#. module: crm_claim
|
||||
#: view:crm.claim.report:0
|
||||
|
@ -402,7 +402,7 @@ msgstr "Значение претензии"
|
|||
#. module: crm_claim
|
||||
#: view:crm.claim:0
|
||||
msgid "Responsible User"
|
||||
msgstr ""
|
||||
msgstr "Ответственный пользователь"
|
||||
|
||||
#. module: crm_claim
|
||||
#: help:crm.claim,email_cc:0
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_event"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_event_unread" model="ir.values">
|
||||
<field name="name">action_event_event_unread</field>
|
||||
|
@ -82,7 +82,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_event"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_event_read" model="ir.values">
|
||||
<field name="name">action_event_event_read</field>
|
||||
|
@ -100,12 +100,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Events" version="7.0">
|
||||
<header>
|
||||
<span groups="base.group_user">
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" class="oe_highlight"/>
|
||||
<button string="Event Ended" name="button_done" states="confirm" type="object" class="oe_highlight"/>
|
||||
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" />
|
||||
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object"/>
|
||||
</span>
|
||||
<button string="Confirm Event" name="button_confirm" states="draft" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button string="Event Ended" name="button_done" states="confirm" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" groups="base.group_user"/>
|
||||
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" groups="base.group_user"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
@ -398,7 +396,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_registration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_registration_unread" model="ir.values">
|
||||
<field name="name">action_event_registration_unread</field>
|
||||
|
@ -416,7 +414,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_event_registration"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_event_registration_read" model="ir.values">
|
||||
<field name="name">action_event_registration_read</field>
|
||||
|
|
|
@ -40,7 +40,7 @@ class sale_order_line(osv.osv):
|
|||
'event_id': fields.many2one('event.event', 'Event', help="Choose an event and it will automatically create a registration for this event."),
|
||||
#those 2 fields are used for dynamic domains and filled by onchange
|
||||
'event_type_id': fields.related('event_type_id', type='many2one', relation="event.type", string="Event Type"),
|
||||
'event_ok': fields.related('event_ok', string='event_ok', type='boolean'),
|
||||
'event_ok': fields.related('product_id', 'event_ok', string='event_ok', type='boolean'),
|
||||
}
|
||||
|
||||
def product_id_change(self, cr, uid, ids,
|
||||
|
|
|
@ -231,7 +231,7 @@ class hr_employee(osv.osv):
|
|||
def onchange_address_id(self, cr, uid, ids, address, context=None):
|
||||
if address:
|
||||
address = self.pool.get('res.partner').browse(cr, uid, address, context=context)
|
||||
return {'value': {'work_email': address.email, 'work_phone': address.phone, 'mobile_phone': address.mobile}}
|
||||
return {'value': {'work_phone': address.phone, 'mobile_phone': address.mobile}}
|
||||
return {'value': {}}
|
||||
|
||||
def onchange_company(self, cr, uid, ids, company, context=None):
|
||||
|
|
|
@ -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-05-10 18:17+0000\n"
|
||||
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2012-10-22 07:48+0000\n"
|
||||
"Last-Translator: nanothole <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-10-19 05:20+0000\n"
|
||||
"X-Generator: Launchpad (build 16165)\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-23 04:48+0000\n"
|
||||
"X-Generator: Launchpad (build 16179)\n"
|
||||
|
||||
#. module: hr
|
||||
#: model:process.node,name:hr.process_node_openerpuser0
|
||||
|
@ -56,7 +56,7 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: model:ir.actions.act_window,name:hr.view_department_form_installer
|
||||
msgid "Create Your Departments"
|
||||
msgstr ""
|
||||
msgstr "Sukurkite padalinius"
|
||||
|
||||
#. module: hr
|
||||
#: model:ir.actions.act_window,help:hr.action_hr_job
|
||||
|
@ -77,12 +77,12 @@ msgstr "Padalinys"
|
|||
#. module: hr
|
||||
#: view:hr.job:0
|
||||
msgid "Mark as Old"
|
||||
msgstr ""
|
||||
msgstr "Pažymeti kaip sena"
|
||||
|
||||
#. module: hr
|
||||
#: view:hr.job:0
|
||||
msgid "Jobs"
|
||||
msgstr ""
|
||||
msgstr "Darbai"
|
||||
|
||||
#. module: hr
|
||||
#: view:hr.job:0
|
||||
|
@ -103,7 +103,7 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: model:ir.actions.todo.category,name:hr.category_hr_management_config
|
||||
msgid "HR Management"
|
||||
msgstr ""
|
||||
msgstr "Žmogiškųjų išteklių valdymas"
|
||||
|
||||
#. module: hr
|
||||
#: help:hr.employee,partner_id:0
|
||||
|
@ -130,7 +130,7 @@ msgstr "Pastabos"
|
|||
#. module: hr
|
||||
#: selection:hr.employee,marital:0
|
||||
msgid "Married"
|
||||
msgstr ""
|
||||
msgstr "Vedęs"
|
||||
|
||||
#. module: hr
|
||||
#: model:ir.actions.act_window,help:hr.action_create_hr_employee_installer
|
||||
|
@ -152,7 +152,7 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: field:hr.employee,color:0
|
||||
msgid "Color Index"
|
||||
msgstr ""
|
||||
msgstr "Spalvos indeksas"
|
||||
|
||||
#. module: hr
|
||||
#: model:process.transition,note:hr.process_transition_employeeuser0
|
||||
|
@ -169,7 +169,7 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: field:hr.employee,identification_id:0
|
||||
msgid "Identification No"
|
||||
msgstr ""
|
||||
msgstr "Asmens kodas"
|
||||
|
||||
#. module: hr
|
||||
#: selection:hr.employee,gender:0
|
||||
|
@ -185,12 +185,12 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: model:ir.ui.menu,name:hr.menu_open_view_attendance_reason_new_config
|
||||
msgid "Attendance"
|
||||
msgstr ""
|
||||
msgstr "Lankomumas"
|
||||
|
||||
#. module: hr
|
||||
#: view:hr.employee:0
|
||||
msgid "Social IDs"
|
||||
msgstr ""
|
||||
msgstr "SODRA Nr."
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.employee,work_phone:0
|
||||
|
@ -206,7 +206,7 @@ msgstr "Žemesniosios kategorijos"
|
|||
#: view:hr.job:0 field:hr.job,description:0
|
||||
#: model:ir.model,name:hr.model_hr_job
|
||||
msgid "Job Description"
|
||||
msgstr ""
|
||||
msgstr "Darbo aprašymas"
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.employee,work_location:0
|
||||
|
@ -227,7 +227,7 @@ msgstr "Darbuotojas"
|
|||
#. module: hr
|
||||
#: model:process.node,note:hr.process_node_employeecontact0
|
||||
msgid "Other information"
|
||||
msgstr ""
|
||||
msgstr "Kita informacija"
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.employee,work_email:0
|
||||
|
@ -237,7 +237,7 @@ msgstr "Darbo el. paštas"
|
|||
#. module: hr
|
||||
#: field:hr.employee,birthday:0
|
||||
msgid "Date of Birth"
|
||||
msgstr ""
|
||||
msgstr "Gimimo data"
|
||||
|
||||
#. module: hr
|
||||
#: model:ir.ui.menu,name:hr.menu_hr_reporting
|
||||
|
@ -253,7 +253,7 @@ msgstr ""
|
|||
#. module: hr
|
||||
#: view:hr.employee:0 field:hr.employee,job_id:0 view:hr.job:0
|
||||
msgid "Job"
|
||||
msgstr ""
|
||||
msgstr "Darbas"
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.department,member_ids:0
|
||||
|
@ -268,7 +268,7 @@ msgstr "Nustatymai"
|
|||
#. module: hr
|
||||
#: view:hr.employee:0 field:hr.employee,category_ids:0
|
||||
msgid "Categories"
|
||||
msgstr ""
|
||||
msgstr "Kategorijos"
|
||||
|
||||
#. module: hr
|
||||
#: field:hr.job,expected_employees:0
|
||||
|
@ -799,3 +799,6 @@ msgstr ""
|
|||
#~ msgstr ""
|
||||
#~ "Objekto pavadinimas turi prasidėti su x_ ir jame negali būti specialiųjų "
|
||||
#~ "ženklų!"
|
||||
|
||||
#~ msgid "Work E-mail"
|
||||
#~ msgstr "Darbinis el. paštas"
|
||||
|
|
|
@ -86,6 +86,8 @@ class report_custom(report_rml):
|
|||
for att in attendences:
|
||||
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
|
||||
if ldt and att['action'] == 'sign_out':
|
||||
if dt.date() > ldt.date():
|
||||
dt = ldt
|
||||
wh += (float((dt - ldt).seconds)/60/60)
|
||||
else:
|
||||
ldt = dt
|
||||
|
|
|
@ -38,7 +38,7 @@ class report_custom(report_rml):
|
|||
|
||||
def create_xml(self, cr, uid, ids, datas, context=None):
|
||||
obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
|
||||
|
||||
ids = datas['active_ids']
|
||||
start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
|
||||
end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
|
||||
first_monday = start_date - relativedelta(days=start_date.date().weekday())
|
||||
|
|
|
@ -37,6 +37,7 @@ class hr_attendance_byweek(osv.osv_memory):
|
|||
def print_report(self, cr, uid, ids, context=None):
|
||||
datas = {
|
||||
'ids': [],
|
||||
'active_ids': context['active_ids'],
|
||||
'model': 'hr.employee',
|
||||
'form': self.read(cr, uid, ids)[0]
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@
|
|||
<form string="Interview Appraisal" version="7.0">
|
||||
<header>
|
||||
<button string="Cancel" name="survey_req_cancel" type="object"
|
||||
states="draft,waiting_answer"/>
|
||||
states="draft,waiting_answer" class="oe_left"/>
|
||||
<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"/>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<record id="product_expense_installer_tree_view" model="ir.ui.view">
|
||||
<field name="name">product.product.tree</field>
|
||||
<field name="model">product.product</field>
|
||||
<field eval="7" name="priority"/>
|
||||
<field eval="37" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="Products">
|
||||
<field name="name"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_holidays_unread" model="ir.values">
|
||||
<field name="name">action_holidays_unread</field>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_holidays"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_holidays_read" model="ir.values">
|
||||
<field name="name">action_holidays_read</field>
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
<field name="name">applicants.status.tree</field>
|
||||
<field name="model">hr.applicant</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state == 'draft';black:state in ('open','pending','done','cancel');" string="Applicants Status">
|
||||
<tree string="Applicants Status">
|
||||
<field name="create_date"/>
|
||||
<field name="job_id"/>
|
||||
<field name="partner_name"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
<field name="user_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<field name="inherit_id" ref="hr.board_hr_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/board/column[1]" position="inside">
|
||||
<action name="%(action_applicants_status)d" string="Applicants To be Processed"/>
|
||||
<action name="%(action_applicants_status)d" string="Applications to be Processed"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -313,7 +313,7 @@ You can automatically receive job application though an email gateway, see the H
|
|||
<field eval="0" name="rating_allow_one_column_require"/>
|
||||
<field name="req_error_msg">This question requires an answer.</field>
|
||||
<field eval="3" name="sequence"/>
|
||||
<field name="question">Exprience</field>
|
||||
<field name="question">Experience</field>
|
||||
<field eval="0" name="is_require_answer"/>
|
||||
<field name="type">comment</field>
|
||||
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
priority: '3'
|
||||
user_id: base.user_demo
|
||||
partner_name: 'Marie Justine'
|
||||
state: 'open'
|
||||
partner_mobile: '9988774455'
|
||||
job_id: hr.job_developer
|
||||
stage_id: stage_job4
|
||||
|
@ -41,7 +40,6 @@
|
|||
type_id: degree_bac5
|
||||
user_id: base.user_root
|
||||
partner_name: 'Sandra Elvis'
|
||||
state: 'cancel'
|
||||
stage_id: stage_job6
|
||||
name: 'More than 5 yrs Experience in PHP'
|
||||
-
|
||||
|
@ -50,7 +48,6 @@
|
|||
type_id: degree_licenced
|
||||
user_id: base.user_demo
|
||||
partner_name: 'John Bruno'
|
||||
state: 'done'
|
||||
job_id: hr.job_developer
|
||||
color: 5
|
||||
stage_id: stage_job5
|
||||
|
@ -61,8 +58,6 @@
|
|||
type_id: degree_licenced
|
||||
priority: '4'
|
||||
partner_name: 'David Armstrong'
|
||||
state: 'pending'
|
||||
state: open
|
||||
partner_mobile: '9966332214'
|
||||
job_id: hr.job_developer
|
||||
stage_id: stage_job2
|
||||
|
@ -73,7 +68,6 @@
|
|||
date: !eval time.strftime('%Y-%m-12 17:49:19')
|
||||
type_id: degree_bac5
|
||||
partner_name: 'Tina Augustie'
|
||||
state: 'open'
|
||||
partner_mobile: '9898745745'
|
||||
job_id: hr.job_developer
|
||||
stage_id: stage_job4
|
||||
|
@ -85,7 +79,6 @@
|
|||
date: !eval time.strftime('%Y-%m-12 17:49:19')
|
||||
type_id: degree_bac5
|
||||
partner_name: 'Shane Williams'
|
||||
state: 'open'
|
||||
partner_mobile: '9812398524'
|
||||
stage_id: stage_job4
|
||||
name: 'Programmer'
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_applicant"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_applicant_unread" model="ir.values">
|
||||
<field name="name">action_project_unread</field>
|
||||
|
@ -60,7 +60,7 @@
|
|||
<field name="type">ir.actions.server</field>
|
||||
<field name="model_id" ref="model_hr_applicant"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
<field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
|
||||
</record>
|
||||
<record id="action_applicant_read" model="ir.values">
|
||||
<field name="name">action_project_read</field>
|
||||
|
|
|
@ -0,0 +1,642 @@
|
|||
# Macedonian 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-10-20 13:07+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Macedonian <mk@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-10-21 04:41+0000\n"
|
||||
"X-Generator: Launchpad (build 16165)\n"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Wed"
|
||||
msgstr "Сре"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "(Keep empty for current_time)"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:132
|
||||
#, python-format
|
||||
msgid "No employee defined for your user !"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Group By..."
|
||||
msgstr "Групирај По..."
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,help:hr_timesheet.action_hr_timesheet_sign_in
|
||||
msgid ""
|
||||
"Employees can encode their time spent on the different projects. A project "
|
||||
"is an analytic account and the time spent on a project generate costs on the "
|
||||
"analytic account. This feature allows to record at the same time the "
|
||||
"attendance and the timesheet."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Today"
|
||||
msgstr "Денес"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.employee,journal_id:0
|
||||
msgid "Analytic Journal"
|
||||
msgstr "Аналитичка картица"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "Stop Working"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_employee
|
||||
#: model:ir.ui.menu,name:hr_timesheet.menu_hr_timesheet_employee
|
||||
msgid "Employee Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Work done stats"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
#: model:ir.ui.menu,name:hr_timesheet.menu_hr_reporting_timesheet
|
||||
msgid "Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Mon"
|
||||
msgstr "Пон"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid "Sign in"
|
||||
msgstr "Најава"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Fri"
|
||||
msgstr "Пет"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.employee,uom_id:0
|
||||
msgid "UoM"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid ""
|
||||
"Employees can encode their time spent on the different projects they are "
|
||||
"assigned on. A project is an analytic account and the time spent on a "
|
||||
"project generates costs on the analytic account. This feature allows to "
|
||||
"record at the same time the attendance and the timesheet."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.out.project,analytic_amount:0
|
||||
msgid "Minimum Analytic Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.employee:0
|
||||
msgid "Monthly Employee Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "Work done in the last period"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.in.project,state:0
|
||||
#: field:hr.sign.out.project,state:0
|
||||
msgid "Current state"
|
||||
msgstr "Тековен статус"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.in.project,name:0
|
||||
#: field:hr.sign.out.project,name:0
|
||||
msgid "Employees name"
|
||||
msgstr "Име на Вработениот"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.out.project,account_id:0
|
||||
msgid "Project / Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_analytical_timesheet_users
|
||||
msgid "Print Employees Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/hr_timesheet.py:175
|
||||
#: code:addons/hr_timesheet/hr_timesheet.py:177
|
||||
#, python-format
|
||||
msgid "Warning !"
|
||||
msgstr "Внимание !"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:77
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:132
|
||||
#, python-format
|
||||
msgid "UserError"
|
||||
msgstr "Корисничка Грешка"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py:77
|
||||
#, python-format
|
||||
msgid "No cost unit defined for this employee !"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Tue"
|
||||
msgstr "Вто"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_print_employee.py:42
|
||||
#, python-format
|
||||
msgid "Warning"
|
||||
msgstr "Предупредување"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.analytic.timesheet,partner_id:0
|
||||
msgid "Partner"
|
||||
msgstr "Партнер"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "Sign In/Out by Project"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Sat"
|
||||
msgstr "Саб"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Sun"
|
||||
msgstr "Нед"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Analytic account"
|
||||
msgstr "Аналитичко конто"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.employee:0
|
||||
#: view:hr.analytical.timesheet.users:0
|
||||
msgid "Print"
|
||||
msgstr "Печати"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.act_hr_timesheet_line_evry1_all_form
|
||||
#: model:ir.ui.menu,name:hr_timesheet.menu_hr_working_hours
|
||||
msgid "Timesheet Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.users:0
|
||||
msgid "Monthly Employees Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "July"
|
||||
msgstr "Јули"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.in.project,date:0
|
||||
#: field:hr.sign.out.project,date_start:0
|
||||
msgid "Starting Date"
|
||||
msgstr "Почетен датум"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.employee:0
|
||||
msgid "Categories"
|
||||
msgstr "Категории"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: constraint:hr.analytic.timesheet:0
|
||||
msgid "You cannot modify an entry in a Confirmed/Done timesheet !."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: help:hr.employee,product_id:0
|
||||
msgid "Specifies employee's designation as a product with type 'service'."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Total cost"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "September"
|
||||
msgstr "Септември"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_analytic_timesheet
|
||||
msgid "Timesheet Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.analytical.timesheet.users,employee_ids:0
|
||||
msgid "employees"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Stats by month"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
#: field:hr.analytical.timesheet.employee,month:0
|
||||
#: field:hr.analytical.timesheet.users,month:0
|
||||
msgid "Month"
|
||||
msgstr "Месец"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.out.project,info:0
|
||||
msgid "Work Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Invoice Analysis"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.report.xml,name:hr_timesheet.report_user_timesheet
|
||||
msgid "Employee timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_sign_in
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_sign_out
|
||||
msgid "Sign in / Sign out by project"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_define_analytic_structure
|
||||
msgid "Define your Analytic Structure"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid "Sign in / Sign out"
|
||||
msgstr "Најава / Одјава"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/hr_timesheet.py:175
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Analytic journal is not defined for employee %s \n"
|
||||
"Define an employee for the selected user and assign an analytic journal!"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid "(Keep empty for current time)"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.employee:0
|
||||
msgid "Timesheets"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,help:hr_timesheet.action_define_analytic_structure
|
||||
msgid ""
|
||||
"You should create an analytic account structure depending on your needs to "
|
||||
"analyse costs and revenues. In OpenERP, analytic accounts are also used to "
|
||||
"track customer contracts."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.analytic.timesheet,line_id:0
|
||||
msgid "Analytic Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "August"
|
||||
msgstr "Август"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "June"
|
||||
msgstr "Јуни"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.employee:0
|
||||
msgid "Print My Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Date"
|
||||
msgstr "Датум"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "November"
|
||||
msgstr "Ноември"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: constraint:hr.employee:0
|
||||
msgid "Error ! You cannot create recursive Hierarchy of Employees."
|
||||
msgstr "Грешка! Не можете да креирате рекурзивна хиерархија на вработените."
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.out.project,date:0
|
||||
msgid "Closing Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "October"
|
||||
msgstr "Октомври"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "January"
|
||||
msgstr "Јануари"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Key dates"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:43
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:77
|
||||
#, python-format
|
||||
msgid "Thu"
|
||||
msgstr "Чет"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Analysis stats"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_analytical_timesheet_employee
|
||||
msgid "Print Employee Timesheet & Print My Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.in.project,emp_id:0
|
||||
#: field:hr.sign.out.project,emp_id:0
|
||||
msgid "Employee ID"
|
||||
msgstr "Идентификационен Број на Вработениот"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "General Information"
|
||||
msgstr "Општи информации"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_my
|
||||
msgid "My Current Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "December"
|
||||
msgstr "Декември"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.employee:0
|
||||
#: view:hr.analytical.timesheet.users:0
|
||||
#: view:hr.sign.in.project:0
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "Cancel"
|
||||
msgstr "Откажи"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,name:hr_timesheet.action_hr_timesheet_users
|
||||
#: model:ir.actions.report.xml,name:hr_timesheet.report_users_timesheet
|
||||
#: model:ir.actions.wizard,name:hr_timesheet.wizard_hr_timesheet_users
|
||||
#: model:ir.ui.menu,name:hr_timesheet.menu_hr_timesheet_users
|
||||
msgid "Employees Timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Information"
|
||||
msgstr "Информации"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.analytical.timesheet.employee,employee_id:0
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_employee
|
||||
msgid "Employee"
|
||||
msgstr "Вработен"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.actions.act_window,help:hr_timesheet.act_hr_timesheet_line_evry1_all_form
|
||||
msgid ""
|
||||
"Through this menu you can register and follow your workings hours by project "
|
||||
"every day."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.sign.in.project,server_date:0
|
||||
#: field:hr.sign.out.project,server_date:0
|
||||
msgid "Current Date"
|
||||
msgstr "Тековен датум"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.employee:0
|
||||
msgid "This wizard will print monthly timesheet"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
#: field:hr.employee,product_id:0
|
||||
msgid "Product"
|
||||
msgstr "Продукт"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Invoicing"
|
||||
msgstr "Фактурирање"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "May"
|
||||
msgstr "Мај"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Total time"
|
||||
msgstr "Вкупно време"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid "(local time on the server side)"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_sign_in_project
|
||||
msgid "Sign In By Project"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "February"
|
||||
msgstr "Февруари"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: model:ir.model,name:hr_timesheet.model_hr_sign_out_project
|
||||
msgid "Sign Out By Project"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytical.timesheet.users:0
|
||||
msgid "Employees"
|
||||
msgstr "Вработени"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "March"
|
||||
msgstr "Март"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/report/user_timesheet.py:40
|
||||
#: code:addons/hr_timesheet/report/users_timesheet.py:73
|
||||
#: selection:hr.analytical.timesheet.employee,month:0
|
||||
#: selection:hr.analytical.timesheet.users,month:0
|
||||
#, python-format
|
||||
msgid "April"
|
||||
msgstr "Април"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/hr_timesheet.py:177
|
||||
#, python-format
|
||||
msgid ""
|
||||
"No analytic account defined on the project.\n"
|
||||
"Please set one or we can not automatically fill the timesheet."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Users"
|
||||
msgstr "Корисници"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.in.project:0
|
||||
msgid "Start Working"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:account.analytic.account:0
|
||||
msgid "Stats by user"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: code:addons/hr_timesheet/wizard/hr_timesheet_print_employee.py:42
|
||||
#, python-format
|
||||
msgid "No employee defined for this user"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: field:hr.analytical.timesheet.employee,year:0
|
||||
#: field:hr.analytical.timesheet.users,year:0
|
||||
msgid "Year"
|
||||
msgstr "Година"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.analytic.timesheet:0
|
||||
msgid "Accounting"
|
||||
msgstr "Сметководство"
|
||||
|
||||
#. module: hr_timesheet
|
||||
#: view:hr.sign.out.project:0
|
||||
msgid "Change Work"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Sum"
|
||||
#~ msgstr "Вкупно"
|
||||
|
||||
#~ msgid "Total"
|
||||
#~ msgstr "Вкупно"
|
|
@ -23,7 +23,7 @@
|
|||
import time
|
||||
uid = ref('base.user_demo')
|
||||
new_id = self.create(cr, uid, {'emp_id': ref('hr.employee_qdp'), 'name': 'Quentin Paolino',
|
||||
'server_date': time.strftime('%Y-%m-%d %H:%M:%S'), 'state': 'present'})
|
||||
'server_date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
self.sign_in_result(cr, uid, [new_id], context)
|
||||
-
|
||||
I change my project "Thymbra" and I click on the "Change Work" button of this wizard
|
||||
|
|
|
@ -147,7 +147,7 @@ class hr_si_project(osv.osv_memory):
|
|||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'hr.sign.%s.project' % in_out,
|
||||
'views': [(False,'tree'), (resource_id,'form')],
|
||||
'views': [(resource_id,'form')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
|
|
|
@ -129,17 +129,18 @@ class account_analytic_line(osv.osv):
|
|||
def _default_journal(self, cr, uid, context=None):
|
||||
proxy = self.pool.get('hr.employee')
|
||||
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
||||
return employee.journal_id and employee.journal_id.id or False
|
||||
if record_ids:
|
||||
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
||||
return employee.journal_id and employee.journal_id.id or False
|
||||
return False
|
||||
|
||||
def _default_general_account(self, cr, uid, context=None):
|
||||
proxy = self.pool.get('hr.employee')
|
||||
record_ids = proxy.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
if not record_ids:
|
||||
raise osv.except_osv(_('Error!'), _('Please create an employee associated to this user.'))
|
||||
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
||||
if employee.product_id and employee.product_id.property_account_income:
|
||||
return employee.product_id.property_account_income.id
|
||||
if record_ids:
|
||||
employee = proxy.browse(cr, uid, record_ids[0], context=context)
|
||||
if employee.product_id and employee.product_id.property_account_income:
|
||||
return employee.product_id.property_account_income.id
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
|
@ -176,7 +177,7 @@ account_analytic_line()
|
|||
|
||||
class hr_analytic_timesheet(osv.osv):
|
||||
_inherit = "hr.analytic.timesheet"
|
||||
def on_change_account_id(self, cr, uid, ids, account_id):
|
||||
def on_change_account_id(self, cr, uid, ids, account_id, user_id=False):
|
||||
res = {}
|
||||
if not account_id:
|
||||
return res
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_id" position="replace">
|
||||
<field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/>
|
||||
<field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -72,7 +72,7 @@
|
|||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_id" position="replace">
|
||||
<field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/>
|
||||
<field domain="[('type','in',['normal','contract']),('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -388,7 +388,7 @@ class hr_timesheet_line(osv.osv):
|
|||
return True
|
||||
|
||||
def multi_on_change_account_id(self, cr, uid, ids, account_ids, context=None):
|
||||
return dict([(el, self.on_change_account_id(cr, uid, ids, el)) for el in account_ids])
|
||||
return dict([(el, self.on_change_account_id(cr, uid, ids, el, context.get('user_id', uid))) for el in account_ids])
|
||||
|
||||
|
||||
hr_timesheet_line()
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
<field colspan="4" context="{'user_id':user_id}" name="timesheet_ids" nolabel="1">
|
||||
<tree editable="top" string="Timesheet Lines">
|
||||
<field name="date"/>
|
||||
<field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/>
|
||||
<field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
|
||||
<field name="name"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
|
||||
<field name="to_invoice" widget="selection"/>
|
||||
|
@ -110,7 +110,7 @@
|
|||
</tree>
|
||||
<form string="Timesheet Lines" version="7.0">
|
||||
<field name="date"/>
|
||||
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
|
||||
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
|
||||
<field name="name"/>
|
||||
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
|
||||
<field name="to_invoice"/>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,6 +46,7 @@ class timesheet_report(osv.osv):
|
|||
'department_id':fields.many2one('hr.department','Department',readonly=True),
|
||||
'date_from': fields.date('Date from',readonly=True,),
|
||||
'date_to': fields.date('Date to',readonly=True),
|
||||
'date_current': fields.date('Current date', required=True),
|
||||
'state' : fields.selection([
|
||||
('new', 'New'),
|
||||
('draft','Draft'),
|
||||
|
@ -64,6 +65,9 @@ class timesheet_report(osv.osv):
|
|||
htss.name,
|
||||
htss.date_from,
|
||||
htss.date_to,
|
||||
to_char(htss.date_from, 'YYYY-MM-DD') as day,
|
||||
to_char(htss.date_from, 'YYYY') as year,
|
||||
to_char(htss.date_from, 'MM') as month,
|
||||
count(*) as nbr,
|
||||
aal.unit_amount as quantity,
|
||||
aal.amount as cost,
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
-
|
||||
!record {model: ir.actions.todo, id: config_call_account_template}:
|
||||
action_id: account.action_wizard_multi_chart
|
||||
type: automatic
|
||||
-
|
||||
!python {model: ir.actions.todo}: |
|
||||
install_todo = self.browse(cr, uid, ref('l10n_be.config_call_account_template'))
|
||||
install_todo = self.browse(cr, uid, ref('account.action_wizard_multi_chart_todo'))
|
||||
if install_todo.state == 'open':
|
||||
wiz = self.pool.get('wizard.multi.charts.accounts')
|
||||
values = {
|
||||
|
|
|
@ -1,28 +1,41 @@
|
|||
# Spanish translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# Spanish (Mexico) 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>, 2011.
|
||||
# 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: 2011-01-07 06:07+0000\n"
|
||||
"PO-Revision-Date: 2011-02-15 15:37+0000\n"
|
||||
"POT-Creation-Date: 2011-12-23 09:56+0000\n"
|
||||
"PO-Revision-Date: 2012-10-22 22:58+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Spanish <es@li.org>\n"
|
||||
"Language-Team: Spanish (Mexico) <es_MX@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: 2011-09-05 05:58+0000\n"
|
||||
"X-Generator: Launchpad (build 13830)\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
|
||||
"X-Generator: Launchpad (build 16179)\n"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:ir.module.module,description:l10n_mx.module_meta_information
|
||||
msgid ""
|
||||
"This is the module to manage the accounting chart for Mexico in Open ERP."
|
||||
msgstr ""
|
||||
"Este es el módulo para gestionar el plan contable para Méjico en Open ERP."
|
||||
#: model:account.account.type,name:l10n_mx.account_type_receivable
|
||||
msgid "Receivable"
|
||||
msgstr "Por cobrar"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_equity
|
||||
msgid "Equity"
|
||||
msgstr "Capital"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_tax
|
||||
msgid "Tax"
|
||||
msgstr "Impuesto"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_cash
|
||||
msgid "Cash"
|
||||
msgstr "Efectivo"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:ir.actions.todo,note:l10n_mx.config_call_account_template_mx_chart
|
||||
|
@ -35,16 +48,28 @@ msgid ""
|
|||
"Management/Configuration/Financial Accounting/Financial Accounts/Generate "
|
||||
"Chart of Accounts from a Chart Template."
|
||||
msgstr ""
|
||||
"Generar Plan Contable a partir de una plantilla de Plan. Se le preguntará "
|
||||
"por el nombre de la compañía, la plantilla de plan contable a seguir, el no. "
|
||||
"de dígitos para generar el código de sus cuentas y la cuenta bancaria, la "
|
||||
"divisa para crear Diarios. Por lo tanto, la copia exacta de la plantilla de "
|
||||
"plan contable será generada.\n"
|
||||
"Este es el mismo asistente que se ejecuta desde Gestión "
|
||||
"Financiera/Configuración/Contabilidad Financiera/Contabilidad "
|
||||
"Financiera/Generar Plan Contable a partir de una Plantilla de Plan."
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:ir.module.module,shortdesc:l10n_mx.module_meta_information
|
||||
msgid "Mexico - Chart of Account"
|
||||
msgstr "Méjico - Plan Contable"
|
||||
#: model:account.account.type,name:l10n_mx.account_type_payable
|
||||
msgid "Payable"
|
||||
msgstr "A pagar"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_asset
|
||||
msgid "Asset"
|
||||
msgstr "Activo"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_income
|
||||
msgid "Income"
|
||||
msgstr "Ingreso"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_expense
|
||||
msgid "Expense"
|
||||
msgstr "Gasto"
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:account.account.type,name:l10n_mx.account_type_view
|
||||
msgid "View"
|
||||
msgstr "Vista"
|
||||
|
|
|
@ -27,6 +27,7 @@ import mail_mail
|
|||
import mail_thread
|
||||
import mail_group
|
||||
import mail_vote
|
||||
import mail_favorite
|
||||
import res_partner
|
||||
import res_users
|
||||
import report
|
||||
|
@ -36,4 +37,3 @@ import mail_group_menu
|
|||
import update
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
'description': """
|
||||
Business oriented Social Networking
|
||||
===================================
|
||||
The Social Networking module provides a unified social network abstraction layer allowing applications to display a complete
|
||||
The Social Networking module provides a unified social network abstraction layer allowing applications to display a complete
|
||||
communication history on documents with a fully-integrated email and message management system.
|
||||
|
||||
It enables the users to read and send messages as well as emails. It also provides a feeds page combined to a subscription mechanism that allows to follow documents and to be constantly updated about recent news.
|
||||
|
@ -54,6 +54,7 @@ Main Features
|
|||
'mail_message_view.xml',
|
||||
'mail_mail_view.xml',
|
||||
'mail_followers_view.xml',
|
||||
'mail_favorite_view.xml',
|
||||
'mail_thread_view.xml',
|
||||
'mail_group_view.xml',
|
||||
'res_partner_view.xml',
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
|
||||
|
||||
class mail_favorite(osv.Model):
|
||||
''' Favorite model: relationship table between messages and users. A favorite
|
||||
message is a message the user wants to see in a specific 'Favorite'
|
||||
mailbox, like a starred mechanism. '''
|
||||
|
||||
_name = 'mail.favorite'
|
||||
_description = 'Favorite messages'
|
||||
_columns = {
|
||||
'message_id': fields.many2one('mail.message', 'Message', select=1,
|
||||
ondelete='cascade', required=True),
|
||||
'user_id': fields.many2one('res.users', 'User', select=1,
|
||||
ondelete='cascade', required=True),
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- FOLLOWERS !-->
|
||||
<record model="ir.ui.view" id="view_mail_favorite_tree">
|
||||
<field name="name">mail.favorite.tree</field>
|
||||
<field name="model">mail.favorite</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Favorites">
|
||||
<field name="user_id"/>
|
||||
<field name="message_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_mail_favorite_form">
|
||||
<field name="name">mail.favorite.form</field>
|
||||
<field name="model">mail.favorite</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Favorite Form" version="7.0">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="message_id"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_favorites" model="ir.actions.act_window">
|
||||
<field name="name">Favorites</field>
|
||||
<field name="res_model">mail.favorite</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<!-- Add favorites related menu entries in Settings/Email -->
|
||||
<menuitem name="Favorites" id="menu_email_favorites" parent="base.menu_email"
|
||||
action="action_view_favorites" sequence="40" groups="base.group_no_one"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -41,7 +41,7 @@ class ir_ui_menu(osv.osv):
|
|||
""" Override to take off menu entries (mail.group) the user is not
|
||||
following. Access are done using SUPERUSER_ID to avoid access
|
||||
rights issues for an internal back-end algorithm. """
|
||||
ids = super(ir_ui_menu, self).search(cr, uid, args, offset=0, limit=None, order=order, context=context, count=False)
|
||||
ids = super(ir_ui_menu, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=False)
|
||||
partner_id = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
|
||||
follower_obj = self.pool.get('mail.followers')
|
||||
for menu in self.browse(cr, uid, ids, context=context):
|
||||
|
@ -52,4 +52,6 @@ class ir_ui_menu(osv.osv):
|
|||
], context=context)
|
||||
if not sub_ids:
|
||||
ids.remove(menu.id)
|
||||
if count:
|
||||
return len(ids)
|
||||
return ids
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
##############################################################################
|
||||
|
||||
import logging
|
||||
import openerp
|
||||
import tools
|
||||
|
||||
from email.header import decode_header
|
||||
from openerp import SUPERUSER_ID
|
||||
from operator import itemgetter
|
||||
from osv import osv, orm, fields
|
||||
from tools.translate import _
|
||||
|
||||
|
@ -48,7 +46,10 @@ class mail_message(osv.Model):
|
|||
_order = 'id desc'
|
||||
|
||||
_message_read_limit = 10
|
||||
_message_read_fields = ['id', 'parent_id', 'model', 'res_id', 'body', 'subject', 'date', 'to_read',
|
||||
'type', 'vote_user_ids', 'attachment_ids', 'author_id', 'partner_ids', 'record_name', 'favorite_user_ids']
|
||||
_message_record_name_length = 18
|
||||
_message_read_more_limit = 1024
|
||||
|
||||
def _shorten_name(self, name):
|
||||
if len(name) <= (self._message_record_name_length + 3):
|
||||
|
@ -56,7 +57,9 @@ class mail_message(osv.Model):
|
|||
return name[:self._message_record_name_length] + '...'
|
||||
|
||||
def _get_record_name(self, cr, uid, ids, name, arg, context=None):
|
||||
""" Return the related document name, using get_name. """
|
||||
""" Return the related document name, using name_get. It is included in
|
||||
a try/except statement, because if uid cannot read the related
|
||||
document, he should see a void string instead of crashing. """
|
||||
result = dict.fromkeys(ids, False)
|
||||
for message in self.read(cr, uid, ids, ['model', 'res_id'], context=context):
|
||||
if not message['model'] or not message['res_id']:
|
||||
|
@ -69,7 +72,7 @@ class mail_message(osv.Model):
|
|||
|
||||
def _get_to_read(self, cr, uid, ids, name, arg, context=None):
|
||||
""" Compute if the message is unread by the current user. """
|
||||
res = dict((id, {'to_read': False}) for id in ids)
|
||||
res = dict((id, False) for id in ids)
|
||||
partner_id = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
|
||||
notif_obj = self.pool.get('mail.notification')
|
||||
notif_ids = notif_obj.search(cr, uid, [
|
||||
|
@ -78,16 +81,16 @@ class mail_message(osv.Model):
|
|||
('read', '=', False)
|
||||
], context=context)
|
||||
for notif in notif_obj.browse(cr, uid, notif_ids, context=context):
|
||||
res[notif.message_id.id]['to_read'] = True
|
||||
res[notif.message_id.id] = not notif.read
|
||||
return res
|
||||
|
||||
def _search_to_read(self, cr, uid, obj, name, domain, context=None):
|
||||
""" Search for messages to read by the current user. Condition is
|
||||
inversed because we search unread message on a read column. """
|
||||
if domain[0][2]:
|
||||
read_cond = '(read = false or read is null)'
|
||||
read_cond = "(read = False OR read IS NULL)"
|
||||
else:
|
||||
read_cond = 'read = true'
|
||||
read_cond = "read = True"
|
||||
partner_id = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
|
||||
cr.execute("SELECT message_id FROM mail_notification "\
|
||||
"WHERE partner_id = %%s AND %s" % read_cond,
|
||||
|
@ -132,8 +135,12 @@ class mail_message(osv.Model):
|
|||
type='boolean', string='To read',
|
||||
help='Functional field to search for messages the current user has to read'),
|
||||
'subtype_id': fields.many2one('mail.message.subtype', 'Subtype'),
|
||||
'vote_user_ids': fields.many2many('res.users', 'mail_vote', 'message_id', 'user_id', string='Votes',
|
||||
'vote_user_ids': fields.many2many('res.users', 'mail_vote',
|
||||
'message_id', 'user_id', string='Votes',
|
||||
help='Users that voted for this message'),
|
||||
'favorite_user_ids': fields.many2many('res.users', 'mail_favorite',
|
||||
'message_id', 'user_id', string='Favorite',
|
||||
help='Users that set this message in their favorites'),
|
||||
}
|
||||
|
||||
def _needaction_domain_get(self, cr, uid, context=None):
|
||||
|
@ -142,8 +149,7 @@ class mail_message(osv.Model):
|
|||
return []
|
||||
|
||||
def _get_default_author(self, cr, uid, context=None):
|
||||
# remove context to avoid possible hack in browse with superadmin using context keys that could trigger a specific behavior
|
||||
return self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=None).partner_id.id
|
||||
return self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
|
||||
|
||||
_defaults = {
|
||||
'type': 'email',
|
||||
|
@ -156,33 +162,49 @@ class mail_message(osv.Model):
|
|||
# Vote/Like
|
||||
#------------------------------------------------------
|
||||
|
||||
def vote_toggle(self, cr, uid, ids, user_ids=None, context=None):
|
||||
''' Toggles voting. Done as SUPERUSER_ID because of write access on
|
||||
mail.message not always granted. '''
|
||||
if not user_ids:
|
||||
user_ids = [uid]
|
||||
def vote_toggle(self, cr, uid, ids, context=None):
|
||||
''' Toggles vote. Performed using read to avoid access rights issues.
|
||||
Done as SUPERUSER_ID because uid may vote for a message he cannot modify. '''
|
||||
for message in self.read(cr, uid, ids, ['vote_user_ids'], context=context):
|
||||
for user_id in user_ids:
|
||||
has_voted = user_id in message.get('vote_user_ids')
|
||||
if not has_voted:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'vote_user_ids': [(4, user_id)]}, context=context)
|
||||
else:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'vote_user_ids': [(3, user_id)]}, context=context)
|
||||
return not(has_voted) or False
|
||||
new_has_voted = not (uid in message.get('vote_user_ids'))
|
||||
if new_has_voted:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'vote_user_ids': [(4, uid)]}, context=context)
|
||||
else:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'vote_user_ids': [(3, uid)]}, context=context)
|
||||
return new_has_voted or False
|
||||
|
||||
#------------------------------------------------------
|
||||
# Favorite
|
||||
#------------------------------------------------------
|
||||
|
||||
def favorite_toggle(self, cr, uid, ids, context=None):
|
||||
''' Toggles favorite. Performed using read to avoid access rights issues.
|
||||
Done as SUPERUSER_ID because uid may star a message he cannot modify. '''
|
||||
for message in self.read(cr, uid, ids, ['favorite_user_ids'], context=context):
|
||||
new_is_favorite = not (uid in message.get('favorite_user_ids'))
|
||||
if new_is_favorite:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'favorite_user_ids': [(4, uid)]}, context=context)
|
||||
else:
|
||||
self.write(cr, SUPERUSER_ID, message.get('id'), {'favorite_user_ids': [(3, uid)]}, context=context)
|
||||
return new_is_favorite or False
|
||||
|
||||
#------------------------------------------------------
|
||||
# Message loading for web interface
|
||||
#------------------------------------------------------
|
||||
|
||||
def _message_get_dict(self, cr, uid, message, context=None):
|
||||
""" Return a dict representation of the message.
|
||||
""" Return a dict representation of the message. This representation is
|
||||
used in the JS client code, to display the messages.
|
||||
|
||||
:param dict message: read result of a mail.message
|
||||
"""
|
||||
has_voted = False
|
||||
if uid in message['vote_user_ids']:
|
||||
has_voted = True
|
||||
else:
|
||||
has_voted = False
|
||||
|
||||
is_favorite = False
|
||||
if uid in message['favorite_user_ids']:
|
||||
is_favorite = True
|
||||
|
||||
try:
|
||||
attachment_ids = [{'id': attach[0], 'name': attach[1]} for attach in self.pool.get('ir.attachment').name_get(cr, uid, message['attachment_ids'], context=context)]
|
||||
|
@ -206,35 +228,48 @@ class mail_message(osv.Model):
|
|||
'date': message['date'],
|
||||
'author_id': message['author_id'],
|
||||
'is_author': message['author_id'] and message['author_id'][0] == uid,
|
||||
# TDE note: is this useful ? to check
|
||||
'partner_ids': partner_ids,
|
||||
'parent_id': message['parent_id'] and message['parent_id'][0] or False,
|
||||
# TDE note: see with CHM about votes, how they are displayed (only number, or name_get ?)
|
||||
# 'vote_user_ids': vote_ids,
|
||||
# vote: should only use number of votes
|
||||
'vote_nb': len(message['vote_user_ids']),
|
||||
'has_voted': has_voted,
|
||||
'is_private': message['model'] and message['res_id'],
|
||||
'is_favorite': is_favorite,
|
||||
'to_read': message['to_read'],
|
||||
}
|
||||
|
||||
def _message_read_expandable(self, cr, uid, tree, result, message_loaded, domain, context, parent_id, limit):
|
||||
def _message_read_expandable(self, cr, uid, message_list, read_messages,
|
||||
message_loaded_ids=[], domain=[], context=None, parent_id=False, limit=None):
|
||||
""" Create the expandable message for all parent message read
|
||||
this function is used by message_read
|
||||
TDE note: add default values for args, add some comments
|
||||
|
||||
:param dict tree: tree of message ids
|
||||
:param list message_list: list of messages given by message_read to
|
||||
which we have to add expandables
|
||||
:param dict read_messages: dict [id]: read result of the messages to
|
||||
easily have access to their values, given their ID
|
||||
"""
|
||||
# sort for group items / TDE: move to message_read
|
||||
# result = sorted(result, key=lambda k: k['id'])
|
||||
tree_not = []
|
||||
# expandable for not show message
|
||||
for msg_id in tree:
|
||||
# get all childs
|
||||
not_loaded_ids = self.search(cr, SUPERUSER_ID, [
|
||||
('parent_id', '=', msg_id),
|
||||
('id', 'not in', message_loaded)
|
||||
], context=context, limit=1000)
|
||||
id_list = sorted(read_messages.keys())
|
||||
for message_id in id_list:
|
||||
message = read_messages[message_id]
|
||||
|
||||
# TDE note: check search is correctly implemented in mail.message
|
||||
not_loaded_ids = self.search(cr, uid, [
|
||||
('parent_id', '=', message['id']),
|
||||
('id', 'not in', message_loaded_ids),
|
||||
], context=context, limit=self._message_read_more_limit)
|
||||
# group childs not read
|
||||
id_min = None
|
||||
id_max = None
|
||||
nb = 0
|
||||
|
||||
for not_loaded_id in not_loaded_ids:
|
||||
if not_loaded_id not in tree:
|
||||
if not read_messages.get(not_loaded_id):
|
||||
nb += 1
|
||||
if id_min == None or id_min > not_loaded_id:
|
||||
id_min = not_loaded_id
|
||||
|
@ -243,42 +278,43 @@ class mail_message(osv.Model):
|
|||
tree_not.append(not_loaded_id)
|
||||
else:
|
||||
if nb > 0:
|
||||
result.append({
|
||||
'domain': [('id', '>=', id_min), ('id', '<=', id_max), ('parent_id', '=', msg_id)],
|
||||
message_list.append({
|
||||
'domain': [('id', '>=', id_min), ('id', '<=', id_max), ('parent_id', '=', message_id)],
|
||||
'nb_messages': nb,
|
||||
'type': 'expandable',
|
||||
'parent_id': msg_id,
|
||||
'parent_id': message_id,
|
||||
'id': id_min,
|
||||
'model': message['model']
|
||||
})
|
||||
id_min = None
|
||||
id_max = None
|
||||
nb = 0
|
||||
if nb > 0:
|
||||
result.append({
|
||||
'domain': [('id', '>=', id_min), ('id', '<=', id_max), ('parent_id', '=', msg_id)],
|
||||
message_list.append({
|
||||
'domain': [('id', '>=', id_min), ('id', '<=', id_max), ('parent_id', '=', message_id)],
|
||||
'nb_messages': nb,
|
||||
'type': 'expandable',
|
||||
'parent_id': msg_id,
|
||||
'id': id_min
|
||||
'parent_id': message_id,
|
||||
'id': id_min,
|
||||
'model': message['model'],
|
||||
})
|
||||
|
||||
for msg_id in read_messages.keys() + tree_not:
|
||||
message_loaded_ids.append(msg_id)
|
||||
|
||||
# expandable for limit max
|
||||
ids = self.search(cr, SUPERUSER_ID, domain + [('id', 'not in', message_loaded + tree + tree_not)], context=context, limit=1)
|
||||
ids = self.search(cr, uid, domain + [('id', 'not in', message_loaded_ids)], context=context, limit=1)
|
||||
if len(ids) > 0:
|
||||
result.append({
|
||||
message_list.append({
|
||||
'domain': domain,
|
||||
'nb_messages': 0,
|
||||
'type': 'expandable',
|
||||
'parent_id': parent_id,
|
||||
'id': -1
|
||||
'id': -1,
|
||||
'max_limit': True,
|
||||
})
|
||||
|
||||
result = sorted(result, key=lambda k: k['id'])
|
||||
|
||||
return result
|
||||
|
||||
_message_read_fields = ['id', 'parent_id', 'model', 'res_id', 'body', 'subject', 'date', 'to_read',
|
||||
'type', 'vote_user_ids', 'attachment_ids', 'author_id', 'partner_ids', 'record_name']
|
||||
return message_list
|
||||
|
||||
def _get_parent(self, cr, uid, message, context=None):
|
||||
""" Tools method that tries to get the parent of a mail.message. If
|
||||
|
@ -295,11 +331,11 @@ class mail_message(osv.Model):
|
|||
except (orm.except_orm, osv.except_osv):
|
||||
return False
|
||||
|
||||
def message_read(self, cr, uid, ids=False, domain=[], context=None, parent_id=False, limit=None):
|
||||
def message_read(self, cr, uid, ids=False, domain=[], message_loaded_ids=[], context=None, parent_id=False, limit=None):
|
||||
""" Read messages from mail.message, and get back a structured tree
|
||||
of messages to be displayed as discussion threads. If IDs is set,
|
||||
fetch these records. Otherwise use the domain to fetch messages.
|
||||
After having fetch messages, their parents will be added to obtain
|
||||
After having fetch messages, their parents & child will be added to obtain
|
||||
well formed threads.
|
||||
|
||||
TDE note: update this comment after final method implementation
|
||||
|
@ -310,60 +346,51 @@ class mail_message(osv.Model):
|
|||
further parents
|
||||
:return list: list of trees of messages
|
||||
"""
|
||||
# don't read the message display by .js, in context message_loaded list
|
||||
# TDE note: use an argument, do not use context
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('message_loaded'):
|
||||
domain += [('id', 'not in', context.get('message_loaded'))]
|
||||
if message_loaded_ids:
|
||||
domain += [('id', 'not in', message_loaded_ids)]
|
||||
limit = limit or self._message_read_limit
|
||||
id_tree = []
|
||||
read_messages = {}
|
||||
message_list = []
|
||||
record = None
|
||||
|
||||
# select ids
|
||||
# TDE note: should not receive [None] -> investigate
|
||||
if ids and ids != [None]:
|
||||
# specific IDs given: fetch those ids and return directly the message list
|
||||
if ids:
|
||||
for message in self.read(cr, uid, ids, self._message_read_fields, context=context):
|
||||
message_list.append(self._message_get_dict(cr, uid, message, context=context))
|
||||
message_list = sorted(message_list, key=lambda k: k['id'])
|
||||
return message_list
|
||||
|
||||
# key: ID, value: record
|
||||
ids = self.search(cr, SUPERUSER_ID, domain, context=context, limit=limit)
|
||||
|
||||
# TDE FIXME: check access rights on search are implemented for mail.message
|
||||
# fetch messages according to the domain, add their parents if uid has access to
|
||||
ids = self.search(cr, uid, domain, context=context, limit=limit)
|
||||
for message in self.read(cr, uid, ids, self._message_read_fields, context=context):
|
||||
# if not in record and not in message_loded list
|
||||
if message['id'] not in id_tree and message['id'] not in context.get('message_loaded', []):
|
||||
record = self._message_get_dict(cr, uid, message, context=context)
|
||||
id_tree.append(message['id'])
|
||||
message_list.append(record)
|
||||
# if not in tree and not in message_loded list
|
||||
if not read_messages.get(message.get('id')) and message.get('id') not in message_loaded_ids:
|
||||
read_messages[message.get('id')] = message
|
||||
message_list.append(self._message_get_dict(cr, uid, message, context=context))
|
||||
|
||||
parent = self._get_parent(cr, uid, message, context=context)
|
||||
while parent and parent['id'] != parent_id:
|
||||
if parent['id'] not in id_tree:
|
||||
message = parent
|
||||
id_tree.append(message['id'])
|
||||
# if not in record and not in message_loded list
|
||||
if message['id'] not in context.get('message_loaded', []):
|
||||
record = self._message_get_dict(cr, uid, message, context=context)
|
||||
message_list.append(record)
|
||||
parent = self._get_parent(cr, uid, parent, context=context)
|
||||
# get all parented message if the user have the access
|
||||
parent = self._get_parent(cr, uid, message, context=context)
|
||||
while parent and parent.get('id') != parent_id:
|
||||
if not read_messages.get(parent.get('id')) and parent.get('id') not in message_loaded_ids:
|
||||
read_messages[parent.get('id')] = parent
|
||||
message_list.append(self._message_get_dict(cr, uid, parent, context=context))
|
||||
parent = self._get_parent(cr, uid, parent, context=context)
|
||||
|
||||
# get the child expandable messages for the tree
|
||||
message_list = sorted(message_list, key=lambda k: k['id'])
|
||||
message_list = self._message_read_expandable(cr, uid, message_list, read_messages,
|
||||
message_loaded_ids=message_loaded_ids, domain=domain, context=context, parent_id=parent_id, limit=limit)
|
||||
|
||||
message_list = self._message_read_expandable(cr, uid, id_tree, message_list, context.get('message_loaded', []), domain, context, parent_id, limit)
|
||||
|
||||
# message_list = sorted(message_list, key=lambda k: k['id'])
|
||||
return message_list
|
||||
|
||||
# TDE Note: do we need this ?
|
||||
# def user_free_attachment(self, cr, uid, context=None):
|
||||
# attachment_list = []
|
||||
|
||||
# attachment = self.pool.get('ir.attachment')
|
||||
# attachment_ids = attachment.search(cr, uid, [('res_model','=',''),('create_uid','=',uid)])
|
||||
# attachment_list = []
|
||||
# attachment_ids = attachment.search(cr, uid, [('res_model', '=', 'mail.message'), ('create_uid', '=', uid)])
|
||||
# if len(attachment_ids):
|
||||
# attachment_list = [{'id': attach.id, 'name': attach.name, 'date': attach.create_date} for attach in attachment.browse(cr, uid, attachment_ids, context=context)]
|
||||
|
||||
# return attachment_list
|
||||
|
||||
#------------------------------------------------------
|
||||
|
@ -384,7 +411,8 @@ class mail_message(osv.Model):
|
|||
- Otherwise: raise
|
||||
- create: if
|
||||
- I am in the document message_follower_ids OR
|
||||
- I can write on the related document if res_model, res_id
|
||||
- I can write on the related document if res_model, res_id OR
|
||||
- I create a private message (no model, no res_id)
|
||||
- Otherwise: raise
|
||||
- write: if
|
||||
- I can write on the related document if res_model, res_id
|
||||
|
@ -422,6 +450,10 @@ class mail_message(osv.Model):
|
|||
if operation == 'read':
|
||||
author_ids = [mid for mid, message in message_values.iteritems()
|
||||
if message.get('author_id') and message.get('author_id') == partner_id]
|
||||
# Create: Check messages you create that are private messages -> ir.rule ?
|
||||
elif operation == 'create':
|
||||
author_ids = [mid for mid, message in message_values.iteritems()
|
||||
if not message.get('model') and not message.get('res_id')]
|
||||
else:
|
||||
author_ids = []
|
||||
|
||||
|
@ -480,13 +512,14 @@ class mail_message(osv.Model):
|
|||
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
|
||||
""" Override to explicitely call check_access_rule, that is not called
|
||||
by the ORM. It instead directly fetches ir.rules and apply them. """
|
||||
res = super(mail_message, self).read(cr, uid, ids, fields=fields, context=context, load=load)
|
||||
self.check_access_rule(cr, uid, ids, 'read', context=context)
|
||||
res = super(mail_message, self).read(cr, uid, ids, fields=fields, context=context, load=load)
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
# cascade-delete attachments that are directly attached to the message (should only happen
|
||||
# for mail.messages that act as parent for a standalone mail.mail record).
|
||||
self.check_access_rule(cr, uid, ids, 'unlink', context=context)
|
||||
attachments_to_delete = []
|
||||
for message in self.browse(cr, uid, ids, context=context):
|
||||
for attach in message.attachment_ids:
|
||||
|
@ -514,7 +547,6 @@ class mail_message(osv.Model):
|
|||
fol_objs = fol_obj.browse(cr, uid, fol_ids, context=context)
|
||||
extra_notified = set(fol.partner_id.id for fol in fol_objs)
|
||||
missing_notified = extra_notified - partners_to_notify
|
||||
missing_notified = missing_notified
|
||||
if missing_notified:
|
||||
self.write(cr, SUPERUSER_ID, [newid], {'partner_ids': [(4, p_id) for p_id in missing_notified]}, context=context)
|
||||
|
||||
|
@ -523,7 +555,7 @@ class mail_message(osv.Model):
|
|||
Call mail_notification.notify to manage the email sending
|
||||
"""
|
||||
message = self.browse(cr, uid, newid, context=context)
|
||||
if message and message.model and message.res_id:
|
||||
if message.model and message.res_id:
|
||||
self._notify_followers(cr, uid, newid, message, context=context)
|
||||
|
||||
# add myself if I wrote on my wall, otherwise remove myself author
|
||||
|
|
|
@ -56,8 +56,9 @@
|
|||
<field name="subject" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />
|
||||
<field name="type"/>
|
||||
<field name="author_id"/>
|
||||
<field name="partner_ids"/>
|
||||
<filter string="Unread"
|
||||
name="messages_unread" help="Show messages to read"
|
||||
name="message_unread" help="Show messages to read"
|
||||
domain="[('to_read', '=', True)]"/>
|
||||
<filter string="Comments"
|
||||
name="comments" help="Comments"
|
||||
|
@ -84,25 +85,5 @@
|
|||
<!-- Add menu entry in Settings/Email -->
|
||||
<menuitem name="Messages" id="menu_mail_message" parent="base.menu_email" action="action_view_mail_message"/>
|
||||
|
||||
<record id="action_mail_inbox_feeds" model="ir.actions.client">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', True)],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_archives_feeds" model="ir.actions.client">
|
||||
<field name="name">Archives</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', False)],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_sent_feeds" model="ir.actions.client">
|
||||
<field name="name">Sent</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('author_id.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid} }""/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
|
@ -703,12 +703,12 @@ class mail_thread(osv.AbstractModel):
|
|||
if attachments:
|
||||
ir_attachment = self.pool.get('ir.attachment')
|
||||
mail_message = self.pool.get('mail.message')
|
||||
attachment_ids = ir_attachment.search(cr, SUPERUSER_ID, [('res_model', '=', False), ('res_id', '=', False), ('user_id', '=', uid), ('id', 'in', attachments)], context=context)
|
||||
attachment_ids = ir_attachment.search(cr, SUPERUSER_ID, [('res_model', '=', 'mail.message'), ('res_id', '=', 0), ('create_uid', '=', uid), ('id', 'in', attachments)], context=context)
|
||||
if attachment_ids:
|
||||
ir_attachment.write(cr, SUPERUSER_ID, attachment_ids, {'res_model': self._name, 'res_id': thread_id}, context=context)
|
||||
mail_message.write(cr, SUPERUSER_ID, [new_message_id], {'attachment_ids': [(6, 0, [pid for pid in attachment_ids])]}, context=context)
|
||||
new_message = self.pool.get('mail.message').message_read(cr, uid, [new_message_id], context=context)
|
||||
|
||||
new_message = self.pool.get('mail.message').message_read(cr, uid, [new_message_id], context=context)
|
||||
return new_message
|
||||
|
||||
#------------------------------------------------------
|
||||
|
@ -716,7 +716,7 @@ class mail_thread(osv.AbstractModel):
|
|||
#------------------------------------------------------
|
||||
|
||||
def message_get_subscription_data(self, cr, uid, ids, context=None):
|
||||
""" Wrapper to get subtypes. """
|
||||
""" Wrapper to get subtypes data. """
|
||||
return self._get_subscription_data(cr, uid, ids, None, None, context=context)
|
||||
|
||||
def message_subscribe_users(self, cr, uid, ids, user_ids=None, subtype_ids=None, context=None):
|
||||
|
|
|
@ -1,35 +1,82 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="action_mail_inbox_feeds" model="ir.actions.client">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', True)],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'typeof_thread': 'inbox'} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_to_me_feeds" model="ir.actions.client">
|
||||
<field name="name">To: me</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('partner_ids.user_ids', 'in', [uid]), ('to_read', '=', True), ('author_id.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'typeof_thread': 'inbox'} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_star_feeds" model="ir.actions.client">
|
||||
<field name="name">Favorites</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('favorite_user_ids.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'typeof_thread': 'stared'} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_archives_feeds" model="ir.actions.client">
|
||||
<field name="name">Archives</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', False)],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'typeof_thread': 'archives'} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_sent_feeds" model="ir.actions.client">
|
||||
<field name="name">Sent</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('author_id.user_ids', 'in', [uid])],
|
||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'typeof_thread': 'send'} }""/>
|
||||
</record>
|
||||
|
||||
<!-- MENU -->
|
||||
|
||||
<!-- Top menu item -->
|
||||
<menuitem name="Home"
|
||||
id="mail_feeds_main"
|
||||
<menuitem name="Mails"
|
||||
id="mail.mail_feeds_main"
|
||||
groups="base.group_user"
|
||||
sequence="10"/>
|
||||
|
||||
<!-- Left-side menu: Feeds -->
|
||||
<menuitem id="mail_feeds" name="Feeds" parent="mail.mail_feeds_main" groups="base.group_user" sequence="10"/>
|
||||
<menuitem id="mail.mail_feeds" name="Feeds & Mailbox" parent="mail.mail_feeds_main" groups="base.group_user" sequence="10"/>
|
||||
<menuitem id="mail_my_stuff" name="Organizer" parent="mail.mail_feeds_main"/>
|
||||
|
||||
<record id="mail_inboxfeeds" model="ir.ui.menu">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="action" ref="action_mail_inbox_feeds"/>
|
||||
<field name="parent_id" ref="mail_feeds"/>
|
||||
<field name="parent_id" ref="mail.mail_feeds"/>
|
||||
</record>
|
||||
<record id="mail_tomefeeds" model="ir.ui.menu">
|
||||
<field name="name">To: me</field>
|
||||
<field name="sequence" eval="11"/>
|
||||
<field name="action" ref="action_mail_to_me_feeds"/>
|
||||
<field name="parent_id" ref="mail.mail_feeds"/>
|
||||
</record>
|
||||
<record id="mail_starfeeds" model="ir.ui.menu">
|
||||
<field name="name">Favorites</field>
|
||||
<field name="sequence" eval="14"/>
|
||||
<field name="action" ref="action_mail_star_feeds"/>
|
||||
<field name="parent_id" ref="mail.mail_feeds"/>
|
||||
</record>
|
||||
<record id="mail_archivesfeeds" model="ir.ui.menu">
|
||||
<field name="name">Archives</field>
|
||||
<field name="sequence" eval="12"/>
|
||||
<field name="sequence" eval="16"/>
|
||||
<field name="action" ref="action_mail_archives_feeds"/>
|
||||
<field name="parent_id" ref="mail_feeds"/>
|
||||
<field name="parent_id" ref="mail.mail_feeds"/>
|
||||
</record>
|
||||
<record id="mail_sentfeeds" model="ir.ui.menu">
|
||||
<field name="name">Sent</field>
|
||||
<field name="sequence" eval="13"/>
|
||||
<field name="sequence" eval="18"/>
|
||||
<field name="action" ref="action_mail_sent_feeds"/>
|
||||
<field name="parent_id" ref="mail_feeds"/>
|
||||
<field name="parent_id" ref="mail.mail_feeds"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
|
@ -126,6 +126,19 @@ class res_users(osv.Model):
|
|||
return self.pool.get('res.partner').message_post_api(cr, uid, partner_id, body=body, subject=subject,
|
||||
type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, **kwargs)
|
||||
|
||||
def message_post(self, cr, uid, thread_id, context=None, **kwargs):
|
||||
""" Redirect the posting of message on res.users to the related partner.
|
||||
This is done because when giving the context of Chatter on the
|
||||
various mailboxes, we do not have access to the current partner_id.
|
||||
We therefore post on the user and redirect on its partner. """
|
||||
assert thread_id, "res.users does not support posting global messages"
|
||||
if context and 'thread_model' in context:
|
||||
context['thread_model'] = 'res.partner'
|
||||
if isinstance(thread_id, (list, tuple)):
|
||||
thread_id = thread_id[0]
|
||||
partner_id = self.pool.get('res.users').read(cr, uid, thread_id, ['partner_id'], context=context)['partner_id'][0]
|
||||
return self.pool.get('res.partner').message_post(cr, uid, partner_id, context=context, **kwargs)
|
||||
|
||||
def message_update(self, cr, uid, ids, msg_dict, update_vals=None, context=None):
|
||||
partner_id = self.pool.get('res.users').browse(cr, uid, ids)[0].partner_id.id
|
||||
return self.pool.get('res.partner').message_update(cr, uid, [partner_id], msg_dict,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</record>
|
||||
|
||||
<record id="mail_followers_read_own" model="ir.rule">
|
||||
<field name="name">mail.followers: read its own entries</field>
|
||||
<field name="name">mail.followers: read and write its own entries</field>
|
||||
<field name="model_id" ref="model_mail_followers"/>
|
||||
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
|
||||
<field name="perm_create" eval="False"/>
|
||||
|
|
|
@ -54,13 +54,13 @@
|
|||
/* Specific display of threads in the wall */
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
.openerp ul.oe_mail_wall_threads .oe_mail_msg_content textarea.oe_mail_compose_textarea {
|
||||
.openerp ul.oe_mail_wall_threads .oe_msg_content textarea.oe_mail_compose_textarea {
|
||||
width: 434px;
|
||||
height: 30px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.openerp li.oe_mail_wall_thread:first .oe_mail_msg_notification {
|
||||
.openerp li.oe_mail_wall_thread:first .oe_msg_notification {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
|||
height: 28px;
|
||||
}
|
||||
|
||||
.openerp div.oe_thread_placeholder div.oe_mail_msg_content {
|
||||
.openerp div.oe_thread_placeholder div.oe_msg_content {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
|
@ -181,8 +181,8 @@
|
|||
}
|
||||
|
||||
/* default textarea (oe_mail_compose_textarea), and body textarea for compose form view */
|
||||
.openerp .oe_mail_msg_content textarea.oe_mail_compose_textarea:focus,
|
||||
.openerp .oe_mail_msg_content div.oe_mail_compose_message_body textarea:focus {
|
||||
.openerp .oe_msg_content textarea.oe_mail_compose_textarea:focus,
|
||||
.openerp .oe_msg_content div.oe_mail_compose_message_body textarea:focus {
|
||||
outline: 0;
|
||||
border-color: rgba(82, 168, 236, 0.8);
|
||||
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
|
||||
|
@ -191,10 +191,17 @@
|
|||
}
|
||||
|
||||
.openerp .oe_mail_vote_count,
|
||||
.openerp .oe_mail_msg_vote{
|
||||
.openerp .oe_msg_vote{
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.openerp button.oe_mail_starbox{
|
||||
background: #ff0000;
|
||||
}
|
||||
.openerp button.oe_mail_starbox.oe_stared{
|
||||
background: #00FF00;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_thread_display {
|
||||
white-space: normal;
|
||||
}
|
||||
|
@ -247,35 +254,35 @@
|
|||
margin: 0 0 4px 0;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_notification,
|
||||
.openerp .oe_mail_msg_expandable,
|
||||
.openerp .oe_mail_msg_comment,
|
||||
.openerp .oe_mail_msg_email {
|
||||
.openerp .oe_msg_notification,
|
||||
.openerp .oe_msg_expandable,
|
||||
.openerp .oe_msg_comment,
|
||||
.openerp .oe_msg_email {
|
||||
padding: 8px;
|
||||
background: white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_notification:after,
|
||||
.openerp .oe_mail_msg_comment:after,
|
||||
.openerp .oe_mail_msg_email:after {
|
||||
.openerp .oe_msg_notification:after,
|
||||
.openerp .oe_msg_comment:after,
|
||||
.openerp .oe_msg_email:after {
|
||||
content: "";
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_msg_content {
|
||||
.openerp div.oe_msg_content {
|
||||
float: left;
|
||||
position: relative;
|
||||
width: 486px;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_msg_content > li {
|
||||
.openerp div.oe_msg_content > li {
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content:after {
|
||||
.openerp .oe_msg_content:after {
|
||||
content: "";
|
||||
display: block;
|
||||
clear: both;
|
||||
|
@ -319,23 +326,23 @@
|
|||
/* Messages layout
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
.openerp .oe_mail_msg .oe_mail_msg_title {
|
||||
.openerp .oe_mail_msg .oe_msg_title {
|
||||
margin: 0;
|
||||
font-size: 1.3em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.openerp .oe_mail_msg .oe_mail_msg_title a:link,
|
||||
.openerp .oe_mail_msg .oe_mail_msg_title a:visited {
|
||||
.openerp .oe_mail_msg .oe_msg_title a:link,
|
||||
.openerp .oe_mail_msg .oe_msg_title a:visited {
|
||||
color: #4C4C4C;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg .oe_mail_msg_body {
|
||||
.openerp .oe_mail_msg .oe_msg_body {
|
||||
margin-bottom: .5em;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg .oe_mail_msg_body pre {
|
||||
.openerp .oe_mail_msg .oe_msg_body pre {
|
||||
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
|
||||
margin: 0px;
|
||||
white-space: pre-wrap;
|
||||
|
@ -373,31 +380,31 @@
|
|||
}
|
||||
|
||||
/* Message footer */
|
||||
.openerp .oe_mail_msg .oe_mail_msg_footer {
|
||||
.openerp .oe_mail_msg .oe_msg_footer {
|
||||
color: #888;
|
||||
}
|
||||
.openerp .oe_mail_msg .oe_mail_msg_footer li {
|
||||
.openerp .oe_mail_msg .oe_msg_footer li {
|
||||
float: left;
|
||||
margin-right: 3px;
|
||||
}
|
||||
.openerp .oe_mail_msg .oe_mail_msg_footer li:after {
|
||||
.openerp .oe_mail_msg .oe_msg_footer li:after {
|
||||
content: " · ";
|
||||
}
|
||||
.openerp .oe_mail_msg .oe_mail_msg_footer li:last-child:after {
|
||||
.openerp .oe_mail_msg .oe_msg_footer li:last-child:after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Attachments list */
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments {
|
||||
width: 100%;
|
||||
margin: .5em 0 0 0;
|
||||
padding: .5em 0;
|
||||
list-style-position: inside;
|
||||
}
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments.oe_hidden {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments.oe_hidden {
|
||||
display: none;
|
||||
}
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments li {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments li {
|
||||
float: none;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
|
@ -405,20 +412,28 @@
|
|||
padding: 0;
|
||||
list-style-type: square;
|
||||
}
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments .oe_upload_in_process {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments .oe_upload_in_process {
|
||||
float: right;
|
||||
width: 200px;
|
||||
height: 16px;
|
||||
}
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments .oe_upload_in_process div {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments .oe_upload_in_process div {
|
||||
float: left;
|
||||
width: 38px;
|
||||
height: 16px;
|
||||
margin-right: 2px;
|
||||
background: #66FF66;
|
||||
}
|
||||
.openerp .oe_mail_msg_content ul.oe_mail_msg_attachments .oe_upload_in_process span {
|
||||
.openerp .oe_msg_content ul.oe_msg_attachments .oe_upload_in_process span {
|
||||
color: #aaaaaa;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/* Topbar button
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
.openerp .oe_topbar .oe_topbar_compose_full_email {
|
||||
float: right;
|
||||
margin: 3px 25px 0 0;
|
||||
}
|
|
@ -2,11 +2,11 @@
|
|||
/* Compose Message */
|
||||
/* ------------------------------ */
|
||||
|
||||
.openerp .oe_mail_msg_content .oe_mail_compose_message_footer {
|
||||
.openerp .oe_msg_content .oe_mail_compose_message_footer {
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content .oe_mail_compose_message_footer button.oe_mail_compose_message_button_send {
|
||||
.openerp .oe_msg_content .oe_mail_compose_message_footer button.oe_mail_compose_message_button_send {
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
|||
font-size: 30px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail .oe_mail_msg_attachments input {
|
||||
.openerp .oe_mail .oe_msg_attachments input {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
@ -128,39 +128,39 @@
|
|||
}
|
||||
|
||||
/* form_view: delete white background */
|
||||
.openerp .oe_mail_msg_content div.oe_formview {
|
||||
.openerp .oe_msg_content div.oe_formview {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content div.oe_form_nosheet {
|
||||
.openerp .oe_msg_content div.oe_form_nosheet {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content table.oe_form_group {
|
||||
.openerp .oe_msg_content table.oe_form_group {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content table.oe_form_field,
|
||||
.openerp .oe_mail_msg_content div.oe_form_field {
|
||||
.openerp .oe_msg_content table.oe_form_field,
|
||||
.openerp .oe_msg_content div.oe_form_field {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.openerp .oe_mail_msg_content td.oe_form_group_cell {
|
||||
.openerp .oe_msg_content td.oe_form_group_cell {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
/* subject: change width */
|
||||
.openerp .oe_mail_msg_content .oe_form .oe_form_field input[type='text'] {
|
||||
.openerp .oe_msg_content .oe_form .oe_form_field input[type='text'] {
|
||||
width: 472px;
|
||||
}
|
||||
|
||||
/* body_html: cleditor */
|
||||
.openerp .oe_mail_msg_content div.cleditorMain {
|
||||
.openerp .oe_msg_content div.cleditorMain {
|
||||
border: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
/* destination_partner_ids */
|
||||
.openerp .oe_mail_msg_content div.text-core {
|
||||
.openerp .oe_msg_content div.text-core {
|
||||
height: 22px !important;
|
||||
width: 472px;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -39,6 +39,7 @@ openerp_mail_followers = function(session, mail) {
|
|||
this._check_visibility();
|
||||
this.reinit();
|
||||
this.bind_events();
|
||||
this._super();
|
||||
},
|
||||
|
||||
_check_visibility: function() {
|
||||
|
@ -72,7 +73,7 @@ openerp_mail_followers = function(session, mail) {
|
|||
target: 'new',
|
||||
context: {
|
||||
'default_res_model': self.view.dataset.model,
|
||||
'default_res_id': self.view.datarecord.id
|
||||
'default_res_id': self.view.datarecord.id,
|
||||
},
|
||||
}
|
||||
self.do_action(action, {
|
||||
|
@ -90,12 +91,6 @@ openerp_mail_followers = function(session, mail) {
|
|||
});
|
||||
},
|
||||
|
||||
set_value: function (value_) {
|
||||
this._super(value_);
|
||||
// TDE FIXME: render_value is never called... ask to niv
|
||||
this.render_value();
|
||||
},
|
||||
|
||||
render_value: function () {
|
||||
this.reinit();
|
||||
return this.fetch_followers(this.get("value"));
|
||||
|
@ -187,7 +182,7 @@ openerp_mail_followers = function(session, mail) {
|
|||
display_subtypes:function (data) {
|
||||
var self = this;
|
||||
var subtype_list_ul = this.$('.oe_subtypes');
|
||||
var records = (data[this.view.datarecord.id] || data[null]).message_subtype_data;
|
||||
var records = data[this.view.datarecord.id].message_subtype_data;
|
||||
|
||||
_(records).each(function (record, record_name) {
|
||||
record.name = record_name;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<t t-name="mail.compose_message">
|
||||
<div class="oe_mail_compose_textarea">
|
||||
<img class="oe_mail_icon oe_mail_frame oe_left" alt="User img"/>
|
||||
<div class="oe_mail_msg_content">
|
||||
<div class="oe_msg_content">
|
||||
<!-- contains the composition form -->
|
||||
<!-- default content: old basic textarea -->
|
||||
<div class="oe_mail_post_header">
|
||||
|
@ -55,17 +55,12 @@
|
|||
Template used to display attachments in a mail.message
|
||||
-->
|
||||
<t t-name="mail.thread.message.attachments">
|
||||
<ul t-attf-class="oe_mail_msg_attachments #{widget.attachment_ids[0] and widget.options.thread.show_attachment_link?'':'oe_hidden'}">
|
||||
<t t-foreach="widget.attachment_ids" t-as="attachment">
|
||||
<ul t-attf-class="oe_msg_attachments #{widget.datasets.attachment_ids[0] and widget.options.thread.show_attachment_link?'':'oe_hidden'}">
|
||||
<t t-foreach="widget.datasets.attachment_ids" t-as="attachment">
|
||||
<li>
|
||||
<span t-if="(attachment.upload or attachment.percent_loaded<100)" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}" t-attf-name="{attachment.name || attachment.filename}">
|
||||
<div class="oe_upload_in_process">
|
||||
<span>Upload in progress...</span>
|
||||
<div t-attf-style="{attachment.percent_loaded>0?'':'display:none;'}"/>
|
||||
<div t-attf-style="{attachment.percent_loaded>20?'':'display:none;'}"/>
|
||||
<div t-attf-style="{attachment.percent_loaded>40?'':'display:none;'}"/>
|
||||
<div t-attf-style="{attachment.percent_loaded>60?'':'display:none;'}"/>
|
||||
<div t-attf-style="{attachment.percent_loaded>80?'':'display:none;'}"/>
|
||||
<span>...Upload in progress...</span>
|
||||
</div>
|
||||
<t t-raw="attachment.name || attachment.filename"/>
|
||||
</span>
|
||||
|
@ -94,14 +89,14 @@
|
|||
-->
|
||||
<t t-name="mail.thread.list_recipients">
|
||||
<div class="oe_mail_list_recipients">
|
||||
Post to:
|
||||
<span t-if="widget.context.default_res_id and widget.context.default_res_id" class="oe_all_follower">All Followers</span>
|
||||
<t t-if="!widget.context.default_res_id and widget.context.default_res_id and widget.partner_ids.length"> and </t>
|
||||
Post to:
|
||||
<span t-if="!widget.datasets.is_private" class="oe_all_follower">All Followers</span>
|
||||
<t t-if="!widget.datasets.is_private and widget.datasets.partner_ids.length"> and </t>
|
||||
<t t-set="inc" t-value="0"/>
|
||||
<t t-if="widget.partner_ids.length" t-foreach="widget.partner_ids" t-as="partner"><span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/><a t-attf-href="#model=res.partner&id=#{partner[0]}"><t t-raw="partner[1]"/></a></span><t t-set="inc" t-value="inc+1"/>
|
||||
<t t-if="widget.datasets.partner_ids.length" t-foreach="widget.datasets.partner_ids" t-as="partner"><span t-attf-class="oe_partner_follower #{inc>=3?'oe_hidden':''}"><t t-if="inc" t-raw="', '"/><a t-attf-href="#model=res.partner&id=#{partner[0]}"><t t-raw="partner[1]"/></a></span><t t-set="inc" t-value="inc+1"/>
|
||||
</t>
|
||||
<t t-if="widget.partner_ids.length>=3">
|
||||
<span class="oe_more">, <a><t t-raw="widget.partner_ids.length-3"/> others...</a></span>
|
||||
<t t-if="widget.datasets.partner_ids.length>=3">
|
||||
<span class="oe_more">, <a><t t-raw="widget.datasets.partner_ids.length-3"/> others...</a></span>
|
||||
<a class="oe_more_hidden"><<<</a>
|
||||
</t>
|
||||
</div>
|
||||
|
@ -111,8 +106,7 @@
|
|||
wall main template
|
||||
Template used to display the communication history in the wall.
|
||||
-->
|
||||
<div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manag
|
||||
er_current">
|
||||
<div t-name="mail.wall" class="oe_view_manager oe_mail_wall oe_view_manager_current">
|
||||
<table class="oe_view_manager_header">
|
||||
<colgroup>
|
||||
<col width="33%"/>
|
||||
|
@ -186,59 +180,56 @@
|
|||
</div>
|
||||
|
||||
<!-- default layout -->
|
||||
<li t-name="mail.thread.message" t-attf-class="oe_mail oe_mail_thread_msg #{widget.to_read ?'oe_mail_unread':'oe_mail_read'}">
|
||||
<div t-attf-class="oe_mail_msg_#{widget.type} oe_semantic_html_override">
|
||||
<li t-name="mail.thread.message" t-attf-class="oe_mail oe_mail_thread_msg #{widget.datasets.to_read ?'oe_mail_unread':'oe_mail_read'}">
|
||||
<div t-attf-class="oe_msg_#{widget.datasets.type} oe_semantic_html_override">
|
||||
<!-- message actions (read/unread, reply, delete...) -->
|
||||
<ul class="oe_header">
|
||||
<li class="placeholder-mail-vote"><t t-call="mail.thread.message.vote"/></li>
|
||||
<li t-if="!widget.options.thread.display_on_flat" title="Read" class="oe_read"><a class="oe_read oe_e">W</a></li>
|
||||
<li t-if="!widget.options.thread.display_on_flat" title="Set back to unread" class="oe_unread"><a class="oe_unread oe_e">h</a></li>
|
||||
<li title="Quick reply"><a class="oe_reply oe_e">)</a></li>
|
||||
<t t-if="(widget.is_author and widget.options.message.show_dd_delete) or widget.type == 'email'">
|
||||
<li class="placeholder-mail-star"><t t-call="mail.thread.message.star"/></li>
|
||||
<li t-if="widget.datasets.show_read_unread" title="Read" class="oe_read"><a class="oe_read oe_e">W</a></li>
|
||||
<li t-if="widget.datasets.show_read_unread" title="Set back to unread" class="oe_unread"><a class="oe_unread oe_e">h</a></li>
|
||||
<li title="Quick reply" t-if="widget.datasets.show_reply"><a class="oe_reply oe_e">)</a></li>
|
||||
<t t-if="(widget.datasets.is_author and widget.options.message.show_dd_delete) or widget.datasets.type == 'email'">
|
||||
<li>
|
||||
<span class="oe_dropdown_toggle">
|
||||
<a class="oe_e" title="More options">í</a>
|
||||
<ul class="oe_dropdown_menu">
|
||||
<li t-if="widget.is_author and widget.options.message.show_dd_delete"><a class="oe_mail_msg_delete">Delete</a></li>
|
||||
<!-- Uncomment when adding subtype hiding
|
||||
<li t-if="display['show_hide']">
|
||||
<a href="#" class="oe_mail_msg_hide_type" t-attf-data-subtype='{widget.subtype}'>Hide '<t t-esc="widget.subtype"/>' for this document</a>
|
||||
</li> -->
|
||||
<li t-if="widget.type == 'email'"><a class="oe_mail_msg_details" t-attf-href="#model=mail.message&id=#{widget.id}" >Details</a></li>
|
||||
<li t-if="widget.datasets.is_author and widget.options.message.show_dd_delete"><a class="oe_msg_delete">Delete</a></li>
|
||||
<li t-if="widget.datasets.type == 'email'"><a class="oe_msg_details" t-attf-href="#model=mail.message&id=#{widget.datasets.id}" >Details</a></li>
|
||||
</ul>
|
||||
</span>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
|
||||
<a t-attf-href="#model=res.partner&id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
|
||||
<img class="oe_mail_icon oe_mail_frame oe_left" t-att-src="widget.avatar"/>
|
||||
<a t-attf-href="#model=res.partner&id=#{widget.datasets.author_id[0]}" t-att-title="widget.datasets.author_id[1]">
|
||||
<img class="oe_mail_icon oe_mail_frame oe_left" t-att-src="widget.datasets.avatar"/>
|
||||
</a>
|
||||
|
||||
<div class="oe_mail_msg_content">
|
||||
<div class="oe_msg_content">
|
||||
<!-- message itself -->
|
||||
<div class="oe_mail_msg">
|
||||
<h1 t-if="widget.subject" class="oe_mail_msg_title">
|
||||
<t t-raw="widget.subject"/>
|
||||
<h1 t-if="widget.datasets.subject" class="oe_msg_title">
|
||||
<t t-raw="widget.datasets.subject"/>
|
||||
</h1>
|
||||
<ul class="oe_mail_msg_footer">
|
||||
<li t-if="widget.author_id"><a t-attf-href="#model=res.partner&id=#{widget.author_id[0]}"><t t-raw="widget.author_id[1]"/></a></li>
|
||||
<li><span t-att-title="widget.date"><t t-raw="widget.timerelative"/></span></li>
|
||||
<li t-if="widget.attachment_ids.length > 0">
|
||||
<a class="oe_mail_msg_view_attachments">
|
||||
<t t-if="widget.attachment_ids.length == 1">1 Attachment</t>
|
||||
<t t-if="widget.attachment_ids.length > 1"><t t-raw="widget.attachment_ids.length"/> Attachments</t>
|
||||
<ul class="oe_msg_footer">
|
||||
<li t-if="widget.datasets.author_id"><a t-attf-href="#model=res.partner&id=#{widget.datasets.author_id[0]}"><t t-raw="widget.datasets.author_id[1]"/></a></li>
|
||||
<li><span t-att-title="widget.datasets.date"><t t-raw="widget.datasets.timerelative"/></span></li>
|
||||
<li t-if="widget.datasets.attachment_ids.length > 0">
|
||||
<a class="oe_msg_view_attachments">
|
||||
<t t-if="widget.datasets.attachment_ids.length == 1">1 Attachment</t>
|
||||
<t t-if="widget.datasets.attachment_ids.length > 1"><t t-raw="widget.datasets.attachment_ids.length"/> Attachments</t>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="oe_clear"/>
|
||||
<div class="oe_mail_msg_body">
|
||||
<t t-if="widget.options.message.show_record_name and widget.record_name and (!widget.subject) and !widget.options.thread.thread_level and !widget.options.thread.display_on_flat and widget.model!='res.partner'">
|
||||
<a class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&id=#{widget.res_id}"><t t-raw="widget.record_name"/></a>
|
||||
<div class="oe_msg_body">
|
||||
<t t-if="widget.options.message.show_record_name and widget.datasets.record_name and (!widget.datasets.subject) and !widget.options.thread.thread_level and !widget.options.thread.display_on_thread[0] and widget.datasets.model!='res.partner'">
|
||||
<a class="oe_mail_action_model" t-attf-href="#model=#{widget.datasets.model}&id=#{widget.res_id}"><t t-raw="widget.datasets.record_name"/></a>
|
||||
</t>
|
||||
<t t-raw="widget.body"/>
|
||||
<t t-raw="widget.datasets.body"/>
|
||||
</div>
|
||||
<t t-if="widget.attachment_ids.length > 0">
|
||||
<t t-if="widget.datasets.attachment_ids.length > 0">
|
||||
<div class="oe_clear"></div>
|
||||
<t t-call="mail.thread.message.attachments"/>
|
||||
</t>
|
||||
|
@ -250,30 +241,40 @@
|
|||
|
||||
<!-- expandable message layout -->
|
||||
<li t-name="mail.thread.expandable" class="oe_mail oe_mail_thread_msg oe_mail_unread">
|
||||
<div t-attf-class="oe_mail_msg_#{widget.type} oe_semantic_html_override">
|
||||
<div class="oe_mail_msg_content oe_mail_msg_more_message">
|
||||
<a class="oe_mail_fetch_more">Load more messages <span t-if="widget.nb_messages>0">(<t t-raw="widget.nb_messages"/> messages not display)</span>...</a>
|
||||
<div t-attf-class="oe_msg_#{widget.datasets.type} oe_semantic_html_override">
|
||||
<div class="oe_msg_content oe_msg_more_message">
|
||||
<a class="oe_mail_fetch_more">Load more messages <span t-if="widget.datasets.nb_messages>0">(<t t-raw="widget.datasets.nb_messages"/> messages not display)</span>...</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!--
|
||||
mail.compose_message.button_top_bar
|
||||
render of the button on the user bar for open wizard compose message
|
||||
-->
|
||||
<t t-name="mail.compose_message.button_top_bar">
|
||||
<div class="oe_topbar_compose_full_email">
|
||||
<button class="oe_button oe_highlight">Write an email</button>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<!-- mail.thread.message.vote
|
||||
Template used to display Like/Unlike in a mail.message
|
||||
-->
|
||||
<span t-name="mail.thread.message.vote">
|
||||
<span class="oe_left oe_mail_vote_count">
|
||||
<t t-if='widget.has_voted'>
|
||||
<t t-if='widget.datasets.has_voted'>
|
||||
You
|
||||
</t>
|
||||
<t t-if='(widget.vote_user_ids.length-(widget.has_voted?1:0)) > 0'>
|
||||
<t t-if='widget.has_voted'> and </t>
|
||||
<t t-esc="widget.vote_user_ids.length"/> people
|
||||
<t t-if='(widget.datasets.vote_user_ids.length-(widget.datasets.has_voted?1:0)) > 0'>
|
||||
<t t-if='widget.datasets.has_voted'> and </t>
|
||||
<t t-esc="widget.datasets.vote_user_ids.length"/> people
|
||||
</t>
|
||||
<t t-if='widget.vote_user_ids.length > 0'>
|
||||
<t t-if='widget.datasets.vote_user_ids.length > 0'>
|
||||
agree
|
||||
</t>
|
||||
</span>
|
||||
<button t-attf-class="oe_mail_msg_vote oe_tag">
|
||||
<button t-attf-class="oe_msg_vote oe_tag">
|
||||
<span>
|
||||
<t t-if="!widget.has_voted">Agree</t>
|
||||
<t t-if="widget.has_voted">Undo</t>
|
||||
|
@ -281,4 +282,13 @@
|
|||
</button>
|
||||
</span>
|
||||
|
||||
<!-- mail.thread.message.star
|
||||
Template used to display stared/unstared message in a mail.message
|
||||
-->
|
||||
<span t-name="mail.thread.message.star">
|
||||
<span class="oe_left">
|
||||
<button t-attf-class="oe_mail_starbox oe_tag #{widget.datasets.is_favorite?'oe_stared':''}">*</button>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</template>
|
||||
|
|
|
@ -520,6 +520,10 @@ class test_mail(TestMailMockups):
|
|||
self.assertEqual(message2.subject, _subject, 'mail.message subject incorrect')
|
||||
self.assertEqual(message2.body, group_bird.description, 'mail.message body incorrect')
|
||||
|
||||
def test_30_message_read(self):
|
||||
""" Tests for message_read and expandables. """
|
||||
self.assertTrue(1 == 1, 'Test not implemented, do not replace by return True')
|
||||
|
||||
def test_40_needaction(self):
|
||||
""" Tests for mail.message needaction. """
|
||||
cr, uid, user_admin, group_pigs = self.cr, self.uid, self.user_admin, self.group_pigs
|
||||
|
@ -577,11 +581,19 @@ class test_mail(TestMailMockups):
|
|||
reply_msg = MAIL_TEMPLATE.format(to='Pretty Pigs <group+pigs@example.com>, other@gmail.com', subject='Re: 1',
|
||||
extra='In-Reply-To: %s' % msg1.message_id)
|
||||
self.mail_group.message_process(cr, uid, None, reply_msg)
|
||||
# TDE note: temp various asserts because of the random bug about msg1.child_ids
|
||||
msg_ids = self.mail_message.search(cr, uid, [('model', '=', 'mail.group'), ('res_id', '=', self.group_pigs_id)], limit=1)
|
||||
new_msg = self.mail_message.browse(cr, uid, msg_ids[0])
|
||||
self.assertEqual(new_msg.parent_id, msg1, 'Newly processed mail_message (%d) should have msg1 as parent' % (new_msg.id))
|
||||
|
||||
# 2. References header
|
||||
reply_msg2 = MAIL_TEMPLATE.format(to='Pretty Pigs <group+pigs@example.com>, other@gmail.com', subject='Re: Re: 1',
|
||||
extra='References: <2233@a.com>\r\n\t<3edss_dsa@b.com> %s' % msg1.message_id)
|
||||
self.mail_group.message_process(cr, uid, None, reply_msg2)
|
||||
# TDE note: temp various asserts because of the random bug about msg1.child_ids
|
||||
msg_ids = self.mail_message.search(cr, uid, [('model', '=', 'mail.group'), ('res_id', '=', self.group_pigs_id)], limit=1)
|
||||
new_msg = self.mail_message.browse(cr, uid, msg_ids[0])
|
||||
self.assertEqual(new_msg.parent_id, msg1, 'Newly processed mail_message should have msg1 as parent')
|
||||
|
||||
# 3. Subject contains [<ID>] + model passed to message+process -> only attached to group, not to mail
|
||||
reply_msg3 = MAIL_TEMPLATE.format(to='Pretty Pigs <group+pigs@example.com>, other@gmail.com',
|
||||
|
@ -591,9 +603,15 @@ class test_mail(TestMailMockups):
|
|||
group_pigs.refresh()
|
||||
msg1.refresh()
|
||||
self.assertEqual(5, len(group_pigs.message_ids), 'group should contain 5 messages')
|
||||
# TDE note: python test + debug because of the random error we see with the next assert
|
||||
if len(msg1.child_ids) != 2:
|
||||
msg_ids = self.mail_message.search(cr, uid, [('model', '=', 'mail.group'), ('res_id', '=', self.group_pigs_id)], limit=10)
|
||||
for new_msg in self.mail_message.browse(cr, uid, msg_ids):
|
||||
print new_msg.subject, '(id', new_msg.id, ')', 'parent_id:', new_msg.parent_id
|
||||
print '\tchild_ids', [child.id for child in new_msg.child_ids]
|
||||
self.assertEqual(2, len(msg1.child_ids), 'msg1 should have 2 children now')
|
||||
|
||||
def test_60_vote(self):
|
||||
def test_60_message_vote(self):
|
||||
""" Test designed for the vote/unvote feature. """
|
||||
cr, uid = self.cr, self.uid
|
||||
user_admin = self.res_users.browse(cr, uid, uid)
|
||||
|
@ -613,7 +631,7 @@ class test_mail(TestMailMockups):
|
|||
# Test: msg1 has Admin as voter
|
||||
self.assertEqual(set(msg1.vote_user_ids), set([user_admin]), 'after voting, Admin is not the voter')
|
||||
# Do: Bert vote for msg1
|
||||
self.mail_message.vote_toggle(cr, uid, [msg1.id], [user_bert_id])
|
||||
self.mail_message.vote_toggle(cr, user_bert_id, [msg1.id])
|
||||
msg1.refresh()
|
||||
# Test: msg1 has Admin and Bert as voters
|
||||
self.assertEqual(set(msg1.vote_user_ids), set([user_admin, user_bert]), 'after voting, Admin and Bert are not the voters')
|
||||
|
@ -622,3 +640,7 @@ class test_mail(TestMailMockups):
|
|||
msg1.refresh()
|
||||
# Test: msg1 has Bert as voter
|
||||
self.assertEqual(set(msg1.vote_user_ids), set([user_bert]), 'after unvoting for Admin, Bert is not the voter')
|
||||
|
||||
def test_70_message_favorite(self):
|
||||
""" Tests for favorites. """
|
||||
self.assertTrue(1 == 1, 'Test not implemented, do not replace by return True')
|
||||
|
|
|
@ -22,7 +22,7 @@ check the logs to see if a message we just received was already logged.
|
|||
"""
|
||||
_PREVIOUS_LOG_CHECK = datetime.timedelta(days=365)
|
||||
|
||||
def get_sys_logs(cr, uid):
|
||||
def get_sys_logs(self, cr, uid):
|
||||
"""
|
||||
Utility method to send a publisher warranty get logs messages.
|
||||
"""
|
||||
|
@ -42,7 +42,7 @@ def get_sys_logs(cr, uid):
|
|||
nbr_active_share_users = pool.get("res.users").search(cr, uid, [("share", "=", True), ("date", ">=", limit_date_str)], count=True)
|
||||
user = pool.get("res.users").browse(cr, uid, uid)
|
||||
|
||||
web_base_url = safe_eval(self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', 'False'))
|
||||
web_base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', 'False')
|
||||
msg = {
|
||||
"dbuuid": dbuuid,
|
||||
"nbr_users": nbr_users,
|
||||
|
@ -62,6 +62,7 @@ def get_sys_logs(cr, uid):
|
|||
arguments_raw = urllib.urlencode(arguments)
|
||||
|
||||
url = config.get("publisher_warranty_url")
|
||||
|
||||
uo = urllib2.urlopen(url, arguments_raw, **add_arg)
|
||||
result = {}
|
||||
try:
|
||||
|
@ -84,8 +85,8 @@ class publisher_warranty_contract(osv.osv):
|
|||
"""
|
||||
try:
|
||||
try:
|
||||
result = get_sys_logs(cr, uid)
|
||||
except Exception:
|
||||
result = get_sys_logs(self, cr, uid)
|
||||
except Exception, ex:
|
||||
if cron_mode: # we don't want to see any stack trace in cron
|
||||
return False
|
||||
_logger.debug("Exception while sending a get logs messages", exc_info=1)
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
<field name="model">mail.compose.message</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Compose Email" version="7.0">
|
||||
<!-- truly invisible fields for control and options -->
|
||||
<field name="composition_mode" nolabel="1" invisible="0"/>
|
||||
<field name="model" nolabel="1" invisible="0"/>
|
||||
<field name="res_id" nolabel="1" invisible="0"/>
|
||||
<field name="parent_id" nolabel="1" invisible="0"/>
|
||||
<field name="content_subtype" nolabel="1" invisible="0"/>
|
||||
<!-- visible wizard -->
|
||||
<group>
|
||||
<!-- truly invisible fields for control and options -->
|
||||
<field name="composition_mode" invisible="1"/>
|
||||
<field name="model" invisible="1"/>
|
||||
<field name="res_id" invisible="1"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<field name="content_subtype" invisible="1"/>
|
||||
<!-- visible wizard -->
|
||||
<field name="subject" placeholder="Subject..."
|
||||
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>/>
|
||||
<field name="partner_ids" widget="many2many_tags" placeholder="Add contacts to notify..."
|
||||
|
|
|
@ -668,7 +668,7 @@
|
|||
<page string="Consumed Products">
|
||||
<group>
|
||||
<group string="Products to Consume">
|
||||
<field name="move_lines" nolabel="1">
|
||||
<field name="move_lines" nolabel="1" options="{'reload_on_button': true}">
|
||||
<tree colors="blue:state == 'draft';black:state in ('picking_except','confirmed','ready','in_production');gray:state in ('cancel','done') " string="Products to Consume">
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty" string="Quantity"/>
|
||||
|
|
|
@ -110,7 +110,7 @@ class procurement_order(osv.osv):
|
|||
|
||||
def production_order_create_note(self, cr, uid, ids, context=None):
|
||||
for procurement in self.browse(cr, uid, ids, context=context):
|
||||
body = _("Manufacturing Order created.")
|
||||
body = _("Manufacturing Order <em>%s</em> created.") % ( procurement.production_id.name,)
|
||||
self.message_post(cr, uid, [procurement.id], body=body, context=context)
|
||||
|
||||
procurement_order()
|
||||
|
|
|
@ -24,7 +24,6 @@ access_account_account,account.account mrp_worker,account.model_account_account,
|
|||
access_purchase_order_mrp_worker,purchase.order mrp_worker,purchase.model_purchase_order,mrp.group_mrp_user,1,0,0,0
|
||||
access_purchase_order_line_mrp_worker,purchase.order.line mrp_worker,purchase.model_purchase_order_line,mrp.group_mrp_user,1,0,0,0
|
||||
access_hr_timesheet_group_mrp_worker,resource.calendar mrp_manager,resource.model_resource_calendar,mrp.group_mrp_manager,1,1,1,1
|
||||
access_procurement_stock_worker,procurement.order stock_worker,model_procurement_order,stock.group_stock_user,1,1,1,1
|
||||
access_procurement_user,procurement.order.user,model_procurement_order,base.group_user,1,1,1,1
|
||||
access_mrp_production_stock_worker,mrp.production stock_worker,model_mrp_production,stock.group_stock_user,1,0,0,0
|
||||
access_report_workcenter_load,report.workcenter.load,model_report_workcenter_load,mrp.group_mrp_manager,1,1,1,1
|
||||
|
|
|
|
@ -194,7 +194,7 @@
|
|||
<para style="terp_tblheader_General_Right">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(pos_payment_user_total(data['form'], currency_obj = company.currency_id)) or removeParentNode('blockTable')]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(pos_payment_user_total(data['form']), currency_obj = company.currency_id) or removeParentNode('blockTable')]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
|
|
@ -938,10 +938,11 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
|||
this.renderElement();
|
||||
},
|
||||
addPaymentLine: function(newPaymentLine) {
|
||||
var self = this;
|
||||
var x = new module.PaymentlineWidget(null, {
|
||||
payment_line: newPaymentLine
|
||||
});
|
||||
x.on_delete.add(_.bind(this.deleteLine, this, x));
|
||||
x.on('delete_payment_line', self, self.deleteLine);
|
||||
x.appendTo(this.$('#paymentlines'));
|
||||
},
|
||||
renderElement: function() {
|
||||
|
|
|
@ -142,7 +142,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
},
|
||||
click_handler: function() {
|
||||
this.order.selectLine(this.model);
|
||||
this.on_selected();
|
||||
this.trigger('order_line_selected');
|
||||
},
|
||||
renderElement: function() {
|
||||
this._super();
|
||||
|
@ -153,10 +153,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
},
|
||||
refresh: function(){
|
||||
this.renderElement();
|
||||
this.on_refresh();
|
||||
this.trigger('order_line_refreshed');
|
||||
},
|
||||
on_selected: function() {},
|
||||
on_refresh: function(){},
|
||||
});
|
||||
|
||||
module.OrderWidget = module.PosBaseWidget.extend({
|
||||
|
@ -230,8 +228,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
model: orderLine,
|
||||
order: this.pos.get('selectedOrder'),
|
||||
});
|
||||
line.on_selected.add(_.bind(this.update_numpad, this));
|
||||
line.on_refresh.add(_.bind(this.update_summary, this));
|
||||
line.on('order_line_selected', self, self.update_numpad);
|
||||
line.on('order_line_refreshed', self, self.update_summary);
|
||||
line.appendTo($content);
|
||||
}, this));
|
||||
this.update_numpad();
|
||||
|
@ -303,7 +301,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
this.payment_line = options.payment_line;
|
||||
this.payment_line.bind('change', this.changedAmount, this);
|
||||
},
|
||||
on_delete: function() {},
|
||||
changeAmount: function(event) {
|
||||
var newAmount;
|
||||
newAmount = event.currentTarget.value;
|
||||
|
@ -317,10 +314,13 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
this.renderElement();
|
||||
},
|
||||
renderElement: function() {
|
||||
var self = this;
|
||||
this.name = this.payment_line.get_cashregister().get('journal_id')[1];
|
||||
this._super();
|
||||
this.$('input').keyup(_.bind(this.changeAmount, this));
|
||||
this.$('.delete-payment-line').click(this.on_delete);
|
||||
this.$('.delete-payment-line').click(function() {
|
||||
self.trigger('delete_payment_line');
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -1055,8 +1055,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
|||
this.pos.barcode_reader.disconnect();
|
||||
return new instance.web.Model("ir.model.data").get_func("search_read")([['name', '=', 'action_client_pos_menu']], ['res_id']).pipe(
|
||||
_.bind(function(res) {
|
||||
return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(result) {
|
||||
var action = result.result;
|
||||
return this.rpc('/web/action/load', {'action_id': res[0]['res_id']}).pipe(_.bind(function(action) {
|
||||
action.context = _.extend(action.context || {}, {'cancel_action': {type: 'ir.actions.client', tag: 'reload'}});
|
||||
//self.destroy();
|
||||
this.do_action(action);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<record id="portal_stock_picking_user_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Claims</field>
|
||||
<field ref="crm_claim.model_crm_claim" name="model_id"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in', [user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<record id="portal_task_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Task</field>
|
||||
<field ref="project.model_project_task" name="model_id"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in', [user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<record id="portal_issue_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Issues</field>
|
||||
<field ref="project_issue.model_project_issue" name="model_id"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in', [user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="context">{"search_default_draft":1}</field>
|
||||
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
|
||||
<field name="help">You dont have any quotation.</field>
|
||||
<field name="help">You don't have any quotation.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_order_form" model="ir.actions.act_window">
|
||||
|
@ -23,7 +23,7 @@
|
|||
<field name="view_mode">tree,form,calendar,graph</field>
|
||||
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
|
||||
<field name="context">{"search_default_sales":1}</field>
|
||||
<field name="help">You dont have any sale order.</field>
|
||||
<field name="help">You don't have any sale order.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_tree" model="ir.actions.act_window">
|
||||
|
@ -34,7 +34,7 @@
|
|||
<field name="domain">[('type','=','out')]</field>
|
||||
<field name="context">{'default_type': 'out', 'contact_display': 'partner_address'}</field>
|
||||
<field name="search_view_id" ref="stock.view_picking_out_search"/>
|
||||
<field name="help">You dont have any delivery order.</field>
|
||||
<field name="help">You don't have any delivery order.</field>
|
||||
</record>
|
||||
|
||||
<record id="product_normal_action" model="ir.actions.act_window">
|
||||
|
@ -55,7 +55,7 @@
|
|||
<field name="domain">[('type','=','out_invoice')]</field>
|
||||
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
|
||||
<field name="search_view_id" ref="account.view_account_invoice_filter"/>
|
||||
<field name="help">You dont have any invoice.</field>
|
||||
<field name="help">You don't have any invoice.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_vendor_receipt" model="ir.actions.act_window">
|
||||
|
@ -65,7 +65,7 @@
|
|||
<field name="context">{'type':'receipt'}</field>
|
||||
<field name="search_view_id" ref="account_voucher.view_voucher_filter_customer_pay"/>
|
||||
<field name="target">current</field>
|
||||
<field name="help">You dont have any payment.</field>
|
||||
<field name="help">You don't have any payment.</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Quotations" id="portal_quotations" parent="portal.portal_orders"
|
||||
|
|
|
@ -6,42 +6,42 @@
|
|||
<record id="portal_sale_order_user_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Quotations/Sales Orders</field>
|
||||
<field name="model_id" ref="sale.model_sale_order"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_stock_picking_user_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Delivery Orders</field>
|
||||
<field name="model_id" ref="stock.model_stock_picking"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_stock_picking_user_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Delivery Orders Out</field>
|
||||
<field name="model_id" ref="stock.model_stock_picking_out"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_account_invoice_user_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Account Invoices</field>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_personal_payment" model="ir.rule">
|
||||
<field name="name">Portal Personal Payments</field>
|
||||
<field name="model_id" ref="account_voucher.model_account_voucher"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_personal_contact" model="ir.rule">
|
||||
<field name="name">Portal Personal Contacts</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="domain_force">[('message_follower_ids','in',user.partner_id.id)]</field>
|
||||
<field name="domain_force">[('message_follower_ids','in',[user.partner_id.id])]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -176,6 +176,11 @@ instance.web.ViewManager.include({
|
|||
var notes = new_notes.substring(0,60) +'..';
|
||||
}
|
||||
r.text(nodes.x+60, nodes.y+30, (notes || new_notes)).attr({"title":nodes.notes,"cursor": "default"});
|
||||
r['image']('/web/static/src/img/icons/gtk-info.png', nodes.x, nodes.y+75, 16, 16)
|
||||
.attr({"cursor": "pointer", "title": "Help"})
|
||||
.click(function() {
|
||||
window.open(nodes.url || "http://doc.openerp.com/v6.1/index.php?model=" + nodes.model);
|
||||
});
|
||||
if(nodes.menu) {
|
||||
r['image']('/web/static/src/img/icons/gtk-jump-to.png', nodes.x+100, nodes.y+75, 16, 16)
|
||||
.attr({"cursor": "pointer", "title": nodes.menu.name})
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<div class="oe_view_manager_header" style="padding: 8px;">
|
||||
<div class="oe_header_row">
|
||||
<h2 class="oe_view_title">
|
||||
<span class="oe_view_title_text oe_breadcrumb_title"><t t-esc="action.name"/> (<t t-esc="action.res_model"/>)</span>
|
||||
<span class="oe_view_title_text oe_breadcrumb_title"><t t-esc="action.name"/> (<a t-attf-href="http://doc.openerp.com/v6.1/index.php?model=#{action.res_model}"><t t-esc="action.res_model"/></a>)</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left:10px;">
|
||||
<p><t t-esc="process_help"/></p>
|
||||
<p><t t-raw="process_help"/></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -13,7 +13,7 @@ msgstr ""
|
|||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-19 05:14+0000\n"
|
||||
"X-Launchpad-Export-Date: 2012-10-20 05:07+0000\n"
|
||||
"X-Generator: Launchpad (build 16165)\n"
|
||||
|
||||
#. module: product
|
||||
|
|
|
@ -410,7 +410,7 @@ class product_pricelist_item(osv.osv):
|
|||
'min_quantity': fields.integer('Min. Quantity', required=True, help="The rule only applies if the partner buys/sells equal to or more than this quantity."),
|
||||
'sequence': fields.integer('Sequence', required=True, help="Gives the order in which the pricelist items will be checked. The evaluation gives highest priority to lowest sequence and stops as soon as a matching item is found."),
|
||||
'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="The mode for computing the price for this rule."),
|
||||
'base_pricelist_id': fields.many2one('product.pricelist', 'If Other Pricelist'),
|
||||
'base_pricelist_id': fields.many2one('product.pricelist', 'Other Pricelist'),
|
||||
|
||||
'price_surcharge': fields.float('Price Surcharge',
|
||||
digits_compute= dp.get_precision('Product Price'), help='Specify the fixed amount to add or substract(if negative) to the amount calculated with the discount.'),
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</group>
|
||||
<group col="4" string="Price Computation">
|
||||
<field name="base"/>
|
||||
<field name="base_pricelist_id" attrs="{'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
|
||||
<field name="base_pricelist_id" attrs="{'invisible':[('base', '!=', -1)],'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
|
||||
</group>
|
||||
<group col="6" colspan="5">
|
||||
<label string="New Price ="/>
|
||||
|
|
|
@ -219,7 +219,7 @@
|
|||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you buy or sell,
|
||||
wether it's a physical product, a consumable or service.
|
||||
whether it's a physical product, a consumable or service.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -236,7 +236,7 @@
|
|||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you sell, wether it's
|
||||
You must define a product for everything you sell, whether it's
|
||||
a physical product, a consumable or a service you offer to
|
||||
customers.
|
||||
</p><p>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new product.
|
||||
</p><p>
|
||||
You must define a product for everything you purchase, wheter
|
||||
You must define a product for everything you purchase, whether
|
||||
it's a physical product, a consumable or services you buy to
|
||||
subcontractants.
|
||||
</p><p>
|
||||
|
|
|
@ -777,7 +777,6 @@ class task(base_stage, osv.osv):
|
|||
_defaults = {
|
||||
'stage_id': _get_default_stage_id,
|
||||
'project_id': _get_default_project_id,
|
||||
'state': 'draft',
|
||||
'kanban_state': 'normal',
|
||||
'priority': '2',
|
||||
'progress': 0,
|
||||
|
@ -1030,7 +1029,6 @@ class task(base_stage, osv.osv):
|
|||
'user_id': delegate_data['user_id'] and delegate_data['user_id'][0] or False,
|
||||
'planned_hours': delegate_data['planned_hours'] or 0.0,
|
||||
'parent_ids': [(6, 0, [task.id])],
|
||||
'state': 'draft',
|
||||
'description': delegate_data['new_task_description'] or '',
|
||||
'child_ids': [],
|
||||
'work_ids': []
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue