[MERGE] trunk
bzr revid: qdp-launchpad@openerp.com-20121120141500-2wuk83zchrmstww2
This commit is contained in:
@@ -107,7 +107,7 @@ class account_analytic_line(osv.osv):
|
||||
if journal_id:
|
||||
journal = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
|
||||
if journal.type == 'sale':
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context)
|
||||
product_price_type_ids = product_price_type_obj.search(cr, uid, [('field','=','list_price')], context=context)
|
||||
if product_price_type_ids:
|
||||
pricetype = product_price_type_obj.browse(cr, uid, product_price_type_ids, context=context)[0]
|
||||
# Take the company currency as the reference one
|
||||
|
||||
@@ -486,6 +486,19 @@ class account_bank_statement(osv.osv):
|
||||
default['move_line_ids'] = []
|
||||
return super(account_bank_statement, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def button_journal_entries(self, cr, uid, ids, context=None):
|
||||
ctx = (context or {}).copy()
|
||||
ctx['journal_id'] = self.browse(cr, uid, ids[0], context=context).journal_id.id
|
||||
return {
|
||||
'view_type':'form',
|
||||
'view_mode':'tree',
|
||||
'res_model':'account.move.line',
|
||||
'view_id':False,
|
||||
'type':'ir.actions.act_window',
|
||||
'domain':[('statement_id','in',ids)],
|
||||
'context':ctx,
|
||||
}
|
||||
|
||||
account_bank_statement()
|
||||
|
||||
class account_bank_statement_line(osv.osv):
|
||||
|
||||
@@ -402,6 +402,7 @@ class account_invoice(osv.osv):
|
||||
'default_res_id': ids[0],
|
||||
'default_use_template': True,
|
||||
'default_template_id': template_id,
|
||||
'default_composition_mode': 'comment',
|
||||
})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
@@ -431,7 +432,7 @@ class account_invoice(osv.osv):
|
||||
if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv(_('Invalid Action!'), _('You cannot delete an invoice which is open or paid. You should refund it instead.'))
|
||||
raise osv.except_osv(_('Invalid Action!'), _('You can not delete an invoice which is not cancelled. You should refund it instead.'))
|
||||
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
|
||||
return True
|
||||
|
||||
@@ -983,13 +984,13 @@ class account_invoice(osv.osv):
|
||||
for i in line:
|
||||
i[2]['period_id'] = period_id
|
||||
|
||||
ctx.update(invoice=inv)
|
||||
move_id = move_obj.create(cr, uid, move, context=ctx)
|
||||
new_move_name = move_obj.browse(cr, uid, move_id, context=ctx).name
|
||||
# make the invoice point to that move
|
||||
self.write(cr, uid, [inv.id], {'move_id': move_id,'period_id':period_id, 'move_name':new_move_name}, context=ctx)
|
||||
# Pass invoice in context in method post: used if you want to get the same
|
||||
# account move reference when creating the same invoice after a cancelled one:
|
||||
ctx.update({'invoice':inv})
|
||||
move_obj.post(cr, uid, [move_id], context=ctx)
|
||||
self._log_event(cr, uid, ids)
|
||||
return True
|
||||
|
||||
@@ -436,7 +436,7 @@
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -208,7 +208,7 @@ class account_move_line(osv.osv):
|
||||
if type(period_id) == str:
|
||||
ids = period_obj.search(cr, uid, [('name', 'ilike', period_id)])
|
||||
context.update({
|
||||
'period_id': ids[0]
|
||||
'period_id': ids and ids[0] or False
|
||||
})
|
||||
return context
|
||||
|
||||
@@ -582,7 +582,7 @@ class account_move_line(osv.osv):
|
||||
lines = self.browse(cr, uid, ids, context=context)
|
||||
for l in lines:
|
||||
if l.account_id.type == 'view':
|
||||
raise osv.except_osv(_('Error!'), _('You cannot create journal items on “View” type account %s %s.') % (l.account_id.code, l.account_id.name))
|
||||
return False
|
||||
return True
|
||||
|
||||
def _check_no_closed(self, cr, uid, ids, context=None):
|
||||
@@ -917,7 +917,7 @@ class account_move_line(osv.osv):
|
||||
|
||||
if lines and lines[0]:
|
||||
partner_id = lines[0].partner_id and lines[0].partner_id.id or False
|
||||
if not partner_obj.has_something_to_reconcile(cr, uid, partner_id, context=context):
|
||||
if partner_id and not partner_obj.has_something_to_reconcile(cr, uid, partner_id, context=context):
|
||||
partner_obj.mark_as_reconciled(cr, uid, [partner_id], context=context)
|
||||
return r_id
|
||||
|
||||
|
||||
@@ -41,13 +41,5 @@
|
||||
groups="group_account_user,group_account_manager"
|
||||
parent="account.menu_finance_generic_reporting" sequence="3"/>
|
||||
|
||||
<report id="account_account_balance_landscape"
|
||||
string="Account balance"
|
||||
model="account.account"
|
||||
name="account.account.balance.landscape"
|
||||
rml="account/report/account_balance_landscape.rml"
|
||||
auto="False"
|
||||
menu="False"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -302,11 +302,11 @@
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_gain_loss_tree" model="ir.ui.view">
|
||||
<record id="view_account_gain_loss_tree" model="ir.ui.view">
|
||||
<field name="name">Unrealized Gain or Loss</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Unrealized Gains and losses">
|
||||
<tree string="Unrealized Gains and losses" create="false">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
@@ -322,7 +322,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_gain_loss" model="ir.actions.act_window">
|
||||
<record id="action_account_gain_loss" model="ir.actions.act_window">
|
||||
<field name="name">Unrealized Gain or Loss</field>
|
||||
<field name="res_model">account.account</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -650,7 +650,7 @@
|
||||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id','=',parent.journal_id), ('company_id', '=', parent.company_id)]" name="account_id"/>
|
||||
<field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',parent.journal_id), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
</tree>
|
||||
@@ -661,7 +661,7 @@
|
||||
<field name="ref"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view'), ('company_id', '=', parent.company_id)]" name="account_id"/>
|
||||
<field name="account_id" domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view'), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
<field name="sequence" readonly="0"/>
|
||||
@@ -671,15 +671,24 @@
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Journal Entries" name="move_live_ids">
|
||||
<field name="move_line_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_form_journal_items" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.journal.items.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='import_buttons']" position="inside">
|
||||
<button name="button_journal_entries"
|
||||
string="Journal Items" type="object"
|
||||
attrs="{'invisible':[('state','!=','confirm')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_bank_statement_tree" model="ir.actions.act_window">
|
||||
<field name="name">Bank Statements</field>
|
||||
@@ -1055,7 +1064,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<field name="name">account.move.line.tree</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field eval="4" name="priority"/>
|
||||
@@ -1850,7 +1859,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_subscription_search" model="ir.ui.view">
|
||||
<record id="view_subscription_search" model="ir.ui.view">
|
||||
<field name="name">account.subscription.search</field>
|
||||
<field name="model">account.subscription</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -2159,7 +2168,8 @@
|
||||
<field name="visible" />
|
||||
<field name="complete_tax_set" />
|
||||
</group>
|
||||
<field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
<separator string="Default Taxes" colspan="4"/>
|
||||
<field name="tax_template_ids" colspan="4" nolabel="1"/>
|
||||
<separator string="Properties" colspan="4"/>
|
||||
<group col="4">
|
||||
<field name="property_account_receivable" domain="[('id', 'child_of', [account_root_id])]"/>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<field name="name">Automated Invoice Notification Mail</field>
|
||||
<field name="email_from">${object.user_id.email or object.company_id.email or 'noreply@localhost'}</field>
|
||||
<field name="subject">${object.company_id.name} Invoice (Ref ${object.number or 'n/a' })</field>
|
||||
<field name="email_to">${object.partner_id.email or ''}</field>
|
||||
<field name="email_recipients">${object.partner_id.id}</field>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
|
||||
@@ -7,20 +7,20 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
|
||||
"PO-Revision-Date: 2011-03-17 20:16+0000\n"
|
||||
"PO-Revision-Date: 2012-11-13 15:01+0000\n"
|
||||
"Last-Translator: jpdborgna <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-30 05:06+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-14 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: account
|
||||
#: view:account.invoice.report:0
|
||||
#: view:analytic.entries.report:0
|
||||
msgid "last month"
|
||||
msgstr ""
|
||||
msgstr "Ultimo mes"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
|
||||
@@ -146,7 +146,7 @@ msgstr "Referencia"
|
||||
#. module: account
|
||||
#: view:account.open.closed.fiscalyear:0
|
||||
msgid "Choose Fiscal Year "
|
||||
msgstr ""
|
||||
msgstr "Seleccione el año fiscal "
|
||||
|
||||
#. module: account
|
||||
#: help:account.payment.term,active:0
|
||||
@@ -159,7 +159,7 @@ msgstr ""
|
||||
#: code:addons/account/account_invoice.py:1430
|
||||
#, python-format
|
||||
msgid "Warning!"
|
||||
msgstr ""
|
||||
msgstr "¡Advertencia!"
|
||||
|
||||
#. module: account
|
||||
#: code:addons/account/account.py:3129
|
||||
@@ -187,7 +187,7 @@ msgstr ""
|
||||
#: code:addons/account/wizard/account_move_journal.py:95
|
||||
#, python-format
|
||||
msgid "Journal: %s"
|
||||
msgstr ""
|
||||
msgstr "Diario: %s"
|
||||
|
||||
#. module: account
|
||||
#: help:account.analytic.journal,type:0
|
||||
@@ -228,6 +228,7 @@ msgstr ""
|
||||
#, python-format
|
||||
msgid "Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)"
|
||||
msgstr ""
|
||||
"La factura '%s' está parcialmente pagada: %s%s de %s%s (%s%s pendiente)"
|
||||
|
||||
#. module: account
|
||||
#: model:process.transition,note:account.process_transition_supplierentriesreconcile0
|
||||
@@ -268,7 +269,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: view:account.fiscalyear.close.state:0
|
||||
msgid "Close Fiscalyear"
|
||||
msgstr ""
|
||||
msgstr "Cerrar ejercicio fiscal"
|
||||
|
||||
#. module: account
|
||||
#: field:account.automatic.reconcile,allow_write_off:0
|
||||
@@ -335,7 +336,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: view:account.installer:0
|
||||
msgid "Configure"
|
||||
msgstr ""
|
||||
msgstr "Configurar"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.entries.report,month:0
|
||||
@@ -344,7 +345,7 @@ msgstr ""
|
||||
#: selection:report.account.sales,month:0
|
||||
#: selection:report.account_type.sales,month:0
|
||||
msgid "June"
|
||||
msgstr ""
|
||||
msgstr "Junio"
|
||||
|
||||
#. module: account
|
||||
#: model:ir.actions.act_window,help:account.action_account_moves_bank
|
||||
@@ -378,12 +379,12 @@ msgstr "Fecha de creación"
|
||||
#. module: account
|
||||
#: selection:account.journal,type:0
|
||||
msgid "Purchase Refund"
|
||||
msgstr ""
|
||||
msgstr "Devolución de compra"
|
||||
|
||||
#. module: account
|
||||
#: selection:account.journal,type:0
|
||||
msgid "Opening/Closing Situation"
|
||||
msgstr ""
|
||||
msgstr "Situación de apertura/cierre"
|
||||
|
||||
#. module: account
|
||||
#: help:account.journal,currency:0
|
||||
@@ -393,7 +394,7 @@ msgstr "La moneda utilizada para el extracto"
|
||||
#. module: account
|
||||
#: field:account.open.closed.fiscalyear,fyear_id:0
|
||||
msgid "Fiscal Year to Open"
|
||||
msgstr "Año fiscal para abrir"
|
||||
msgstr "Ejercicio fiscal a abrir"
|
||||
|
||||
#. module: account
|
||||
#: help:account.journal,sequence_id:0
|
||||
@@ -495,7 +496,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: field:account.bank.statement,account_id:0
|
||||
msgid "Account used in this journal"
|
||||
msgstr ""
|
||||
msgstr "Cuenta utilizada en este diario"
|
||||
|
||||
#. module: account
|
||||
#: help:account.aged.trial.balance,chart_account_id:0
|
||||
@@ -557,7 +558,7 @@ msgstr "Cerrar un año fiscal"
|
||||
#. module: account
|
||||
#: model:process.transition,note:account.process_transition_confirmstatementfromdraft0
|
||||
msgid "The accountant confirms the statement."
|
||||
msgstr ""
|
||||
msgstr "El contador confirma la declaración."
|
||||
|
||||
#. module: account
|
||||
#: report:account.account.balance:0
|
||||
@@ -8156,7 +8157,7 @@ msgstr ""
|
||||
#: field:account.bank.statement,balance_end_real:0
|
||||
#: field:account.treasury.report,ending_balance:0
|
||||
msgid "Ending Balance"
|
||||
msgstr "Balance final"
|
||||
msgstr "Saldo Final"
|
||||
|
||||
#. module: account
|
||||
#: help:account.move.line,blocked:0
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="name">account.fiscal.position.form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fiscal Position">
|
||||
<form string="Fiscal Position" version="7.0">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
@@ -114,7 +114,7 @@
|
||||
context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
|
||||
src_model="res.partner"
|
||||
view_type="form"
|
||||
view_mode="tree,form,calendar"/>
|
||||
view_mode="tree,form"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -170,12 +170,12 @@
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Chart of Accounts</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
|
||||
<td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filters' and get_filter(data) ]]</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filters' and get_filter(data) or removeParentNode('para') ]] </para>
|
||||
<blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">Start Date</para></td>
|
||||
|
||||
@@ -299,10 +299,10 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def _get_sortby(self, data):
|
||||
if self.sortby == 'sort_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif self.sortby == 'sort_journal_partner':
|
||||
return 'Journal & Partner'
|
||||
return 'Date'
|
||||
return self._translate('Journal & Partner')
|
||||
return self._translate('Date')
|
||||
|
||||
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal')
|
||||
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape')
|
||||
|
||||
@@ -94,10 +94,10 @@ class common_report_header(object):
|
||||
def _get_filter(self, data):
|
||||
if data.get('form', False) and data['form'].get('filter', False):
|
||||
if data['form']['filter'] == 'filter_date':
|
||||
return 'Date'
|
||||
return self._translate('Date')
|
||||
elif data['form']['filter'] == 'filter_period':
|
||||
return 'Periods'
|
||||
return 'No Filter'
|
||||
return self._translate('Periods')
|
||||
return self._translate('No Filters')
|
||||
|
||||
def _sum_debit_period(self, period_id, journal_id=None):
|
||||
journals = journal_id or self.journal_ids
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -40,7 +39,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -49,7 +47,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -60,7 +57,6 @@
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -71,7 +67,6 @@
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -80,7 +75,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -89,7 +83,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -99,7 +92,6 @@
|
||||
!python {model: account.journal.period}: |
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'period_from':ref('period_1'), 'period_to':ref('period_12')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
@@ -109,7 +101,6 @@
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
@@ -118,7 +109,6 @@
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
@@ -127,7 +117,6 @@
|
||||
!python {model: res.partner}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
@@ -135,7 +124,6 @@
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
from . import test_tax
|
||||
|
||||
fast_suite = [test_tax,
|
||||
]
|
||||
@@ -0,0 +1,49 @@
|
||||
from openerp.tests.common import TransactionCase
|
||||
|
||||
class TestTax(TransactionCase):
|
||||
"""Tests for taxes (account.tax)
|
||||
|
||||
We don't really need at this point to link taxes to tax codes
|
||||
(account.tax.code) nor to companies (base.company) to check computation
|
||||
results.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
super(TestTax, self).setUp()
|
||||
self.tax_model = self.registry('account.tax')
|
||||
|
||||
def test_programmatic_tax(self):
|
||||
cr, uid = self.cr, self.uid
|
||||
tax_id = self.tax_model.create(cr, uid, dict(
|
||||
name="Programmatic tax",
|
||||
type='code',
|
||||
python_compute='result = 12.0',
|
||||
python_compute_inv='result = 11.0',
|
||||
))
|
||||
|
||||
tax_records = self.tax_model.browse(cr, uid, [tax_id])
|
||||
res = self.tax_model.compute_all(cr, uid, tax_records, 50.0, 2)
|
||||
|
||||
tax_detail = res['taxes'][0]
|
||||
self.assertEquals(tax_detail['amount'], 24.0)
|
||||
self.assertEquals(res['total_included'], 124.0)
|
||||
|
||||
def test_percent_tax(self):
|
||||
"""Test computations done by a 10 percent tax."""
|
||||
cr, uid = self.cr, self.uid
|
||||
tax_id = self.tax_model.create(cr, uid, dict(
|
||||
name="Percent tax",
|
||||
type='percent',
|
||||
amount='0.1',
|
||||
))
|
||||
|
||||
tax_records = self.tax_model.browse(cr, uid, [tax_id])
|
||||
res = self.tax_model.compute_all(cr, uid, tax_records, 50.0, 2)
|
||||
|
||||
tax_detail = res['taxes'][0]
|
||||
self.assertEquals(tax_detail['amount'], 10.0)
|
||||
self.assertEquals(res['total_included'], 110.0)
|
||||
|
||||
# now the inverse computation
|
||||
res = self.tax_model.compute_inv(cr, uid, tax_records, 55.0, 2)
|
||||
self.assertEquals(res[0]['amount'], 10.0)
|
||||
@@ -14,15 +14,19 @@
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Filters']" position="after">
|
||||
<page string="Comparison" attrs="{'invisible': [('enable_filter','=',False)]}">
|
||||
<field name="label_filter" attrs="{'required': [('enable_filter', '=', True)]}"/>
|
||||
<field name="fiscalyear_id_cmp"/><newline/>
|
||||
<field name="filter_cmp"/>
|
||||
<separator string="Dates" colspan="4"/>
|
||||
<field name="date_from_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<field name="date_to_cmp" attrs="{'readonly':[('filter_cmp', '!=', 'filter_date')], 'required':[('filter_cmp', '=', 'filter_date')]}" colspan="4"/>
|
||||
<separator string="Periods" colspan="4"/>
|
||||
<field name="period_from_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
<field name="period_to_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'readonly':[('filter_cmp','!=','filter_period')], 'required':[('filter_cmp', '=', 'filter_period')]}" colspan="4"/>
|
||||
<group>
|
||||
<field name="label_filter" attrs="{'required': [('enable_filter', '=', True)]}"/>
|
||||
<field name="fiscalyear_id_cmp"/><newline/>
|
||||
<field name="filter_cmp"/>
|
||||
</group>
|
||||
<group string="Dates" attrs="{'invisible':[('filter_cmp', '!=', 'filter_date')]}">
|
||||
<field name="date_from_cmp" attrs="{'required':[('filter_cmp', '=', 'filter_date')]}"/>
|
||||
<field name="date_to_cmp" attrs="{'required':[('filter_cmp', '=', 'filter_date')]}"/>
|
||||
</group>
|
||||
<group string="Periods" attrs="{'invisible':[('filter_cmp', '!=', 'filter_period')]}">
|
||||
<field name="period_from_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'required':[('filter_cmp', '=', 'filter_period')]}"/>
|
||||
<field name="period_to_cmp" domain="[('fiscalyear_id', '=', fiscalyear_id_cmp)]" attrs="{'required':[('filter_cmp', '=', 'filter_period')]}"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
|
||||
@@ -226,7 +226,7 @@ class account_fiscalyear_close(osv.osv_memory):
|
||||
for account in obj_acc_account.browse(cr, uid, account_ids, context={'fiscalyear': fy_id}):
|
||||
balance_in_currency = 0.0
|
||||
if account.currency_id:
|
||||
cr.execute('SELECT sum(amount_currency) as balance_in_currency FROM account_move_line ' \
|
||||
cr.execute('SELECT sum(COALESCE(amount_currency,0.0)) as balance_in_currency FROM account_move_line ' \
|
||||
'WHERE account_id = %s ' \
|
||||
'AND ' + query_line + ' ' \
|
||||
'AND currency_id = %s', (account.id, account.currency_id.id))
|
||||
|
||||
@@ -27,7 +27,7 @@ class account_open_closed_fiscalyear(osv.osv_memory):
|
||||
_description = "Choose Fiscal Year"
|
||||
_columns = {
|
||||
'fyear_id': fields.many2one('account.fiscalyear', \
|
||||
'Fiscal Year to Open', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
|
||||
'Fiscal Year', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
|
||||
}
|
||||
|
||||
def remove_entries(self, cr, uid, ids, context=None):
|
||||
@@ -36,7 +36,7 @@ class account_open_closed_fiscalyear(osv.osv_memory):
|
||||
data = self.browse(cr, uid, ids, context=context)[0]
|
||||
period_journal = data.fyear_id.end_journal_period_id or False
|
||||
if not period_journal:
|
||||
raise osv.except_osv(_('Error!'), _('You have to set the end of the fiscal year for this journal.'))
|
||||
raise osv.except_osv(_('Error!'), _("You have to set the 'End of Year Entries Journal' for this Fiscal Year which is set after generating opening entries from 'Generate Opening Entries'."))
|
||||
|
||||
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
|
||||
if ids_move:
|
||||
|
||||
@@ -5,14 +5,18 @@
|
||||
<field name="name">account.open.closed.fiscalyear.form</field>
|
||||
<field name="model">account.open.closed.fiscalyear</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Choose Fiscal Year " version="7.0">
|
||||
<form string="Cancel Fiscal Year Opening Entries" version="7.0">
|
||||
<separator string="Cancel Fiscal Year Opening Entries"/>
|
||||
<p class="oe_grey">
|
||||
This wizard will remove the end of year journal entries of selected fiscal year. Note that you can run this wizard many times for the same fiscal year.
|
||||
</p>
|
||||
<group>
|
||||
<field name="fyear_id" domain="[('state','=','draft')]"/>
|
||||
<field name="fyear_id" domain="[('state','=','draft'), ('end_journal_period_id', '!=', False)]"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Open" name="remove_entries" type="object" class="oe_highlight"/>
|
||||
<button string="Cancel Opening Entries" name="remove_entries" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
<button string="Discard" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
<field name="inherit_id" ref="account_common_report_view" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='journal_ids']" position="replace">
|
||||
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>
|
||||
<xpath expr="//notebook/page[@string='Journals']" position="replace">
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='target_move']" position="after">
|
||||
<field name="display_account"/>
|
||||
|
||||
@@ -119,7 +119,11 @@ class account_common_report(osv.osv_memory):
|
||||
|
||||
def _get_fiscalyear(self, cr, uid, context=None):
|
||||
now = time.strftime('%Y-%m-%d')
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
|
||||
company_id = False
|
||||
ids = context.get('active_ids', [])
|
||||
if ids:
|
||||
company_id = self.browse(cr, uid, ids[0], context=context).company_id.id
|
||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1)
|
||||
return fiscalyears and fiscalyears[0] or False
|
||||
|
||||
def _get_all_journal(self, cr, uid, context=None):
|
||||
|
||||
@@ -26,12 +26,10 @@
|
||||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">Accounting and Finance application installed!</field>
|
||||
<field name="body"><![CDATA[
|
||||
With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.
|
||||
|
||||
<p>The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>
|
||||
]]></field>
|
||||
<field name="body"><![CDATA[<p>With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc.</p>
|
||||
<p>The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc.</p>]]></field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -21,17 +21,17 @@
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/tree/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_id']/form/notebook/page/group/group/field[@name='analytic_account_id']" position="replace">
|
||||
<field name="analytics_id" context="{'journal_id':journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytics_id" context="{'journal_id':parent.journal_id}" groups="analytic.group_analytic_accounting"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="journal_col11" model="account.journal.column">
|
||||
<field eval=""""Analytic Distribution"""" name="name"/>
|
||||
<field eval="11" name="sequence"/>
|
||||
<field eval="15" name="sequence"/>
|
||||
<field name="view_id" ref="account.account_journal_view"/>
|
||||
<field eval="0" name="required"/>
|
||||
<field eval=""""analytics_id"""" name="field"/>
|
||||
@@ -276,7 +276,7 @@
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_default_inherit_tree">
|
||||
<record model="ir.ui.view" id="view_default_inherit_tree">
|
||||
<field name="name">account.analytic.default.tree.plans</field>
|
||||
<field name="model">account.analytic.default</field>
|
||||
<field name="inherit_id" ref="account_analytic_default.view_account_analytic_default_tree"/>
|
||||
|
||||
@@ -40,7 +40,7 @@ class account_invoice_line(osv.osv):
|
||||
|
||||
if inv.type in ('out_invoice','out_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if inv.type == 'out_invoice':
|
||||
# debit account dacc will be the output account
|
||||
# first check the product, if empty check the category
|
||||
@@ -87,7 +87,7 @@ class account_invoice_line(osv.osv):
|
||||
})
|
||||
elif inv.type in ('in_invoice','in_refund'):
|
||||
for i_line in inv.invoice_line:
|
||||
if i_line.product_id:
|
||||
if i_line.product_id and i_line.product_id.valuation == 'real_time':
|
||||
if i_line.product_id.type != 'service':
|
||||
# get the price difference account at the product
|
||||
acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id
|
||||
|
||||
@@ -377,16 +377,15 @@ class account_asset_depreciation_line(osv.osv):
|
||||
move_line_obj = self.pool.get('account.move.line')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
created_move_ids = []
|
||||
asset_ids = []
|
||||
for line in self.browse(cr, uid, ids, context=context):
|
||||
if currency_obj.is_zero(cr, uid, line.asset_id.currency_id, line.remaining_value):
|
||||
can_close = True
|
||||
depreciation_date = time.strftime('%Y-%m-%d')
|
||||
period_ids = period_obj.find(cr, uid, depreciation_date, context=context)
|
||||
company_currency = line.asset_id.company_id.currency_id.id
|
||||
current_currency = line.asset_id.currency_id.id
|
||||
context.update({'date': depreciation_date})
|
||||
amount = currency_obj.compute(cr, uid, current_currency, company_currency, line.amount, context=context)
|
||||
sign = line.asset_id.category_id.journal_id.type = 'purchase' and 1 or -1
|
||||
sign = (line.asset_id.category_id.journal_id.type == 'purchase' and 1) or -1
|
||||
asset_name = line.asset_id.name
|
||||
reference = line.name
|
||||
move_vals = {
|
||||
@@ -409,8 +408,8 @@ class account_asset_depreciation_line(osv.osv):
|
||||
'period_id': period_ids and period_ids[0] or False,
|
||||
'journal_id': journal_id,
|
||||
'partner_id': partner_id,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
'amount_currency': company_currency <> current_currency and - sign * line.amount or 0.0,
|
||||
'currency_id': company_currency != current_currency and current_currency or False,
|
||||
'amount_currency': company_currency != current_currency and - sign * line.amount or 0.0,
|
||||
'date': depreciation_date,
|
||||
})
|
||||
move_line_obj.create(cr, uid, {
|
||||
@@ -423,16 +422,19 @@ class account_asset_depreciation_line(osv.osv):
|
||||
'period_id': period_ids and period_ids[0] or False,
|
||||
'journal_id': journal_id,
|
||||
'partner_id': partner_id,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
'amount_currency': company_currency <> current_currency and sign * line.amount or 0.0,
|
||||
'currency_id': company_currency != current_currency and current_currency or False,
|
||||
'amount_currency': company_currency != current_currency and sign * line.amount or 0.0,
|
||||
'analytic_account_id': line.asset_id.category_id.account_analytic_id.id,
|
||||
'date': depreciation_date,
|
||||
'asset_id': line.asset_id.id
|
||||
})
|
||||
self.write(cr, uid, line.id, {'move_id': move_id}, context=context)
|
||||
created_move_ids.append(move_id)
|
||||
if can_close:
|
||||
asset_obj.write(cr, uid, [line.asset_id.id], {'state': 'close'}, context=context)
|
||||
asset_ids.append(line.asset_id.id)
|
||||
# we re-evaluate the assets to determine whether we can close them
|
||||
for asset in asset_obj.browse(cr, uid, list(set(asset_ids)), context=context):
|
||||
if currency_obj.is_zero(cr, uid, asset.currency_id, asset.value_residual):
|
||||
asset.write({'state': 'close'})
|
||||
return created_move_ids
|
||||
|
||||
account_asset_depreciation_line()
|
||||
|
||||
@@ -72,12 +72,12 @@
|
||||
<field name="date" readonly="1"/>
|
||||
<field name="val_date" readonly="1"/>
|
||||
<field name="name"/>
|
||||
<field name="statement_id" readonly="1"/>
|
||||
<field name="statement_id"/>
|
||||
<field name="ref" readonly="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="account_id" domain="[('journal_id','=',journal_id)]"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type', '<>', 'view')]"/>
|
||||
<field name="amount" readonly="1" sum="Total Amount"/>
|
||||
<field name="globalisation_id" string="Glob. Id"/>
|
||||
<field name="globalisation_amount" string="Glob. Am."/>
|
||||
@@ -100,8 +100,8 @@
|
||||
<field name="ref" readonly="0"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '<>', 'view')]"/>
|
||||
<field domain="[('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('type', '<>', 'view')]"/>
|
||||
<field name="amount"/>
|
||||
<field name="globalisation_id"/>
|
||||
<field name="sequence" readonly="0"/>
|
||||
|
||||
@@ -220,7 +220,17 @@
|
||||
<menuitem parent="next_id_31"
|
||||
id="menu_act_crossovered_budget_view"
|
||||
action="act_crossovered_budget_view" sequence="1" />
|
||||
|
||||
|
||||
<record id="view_crossovered_budget_line_search" model="ir.ui.view">
|
||||
<field name="name">account.budget.line.search</field>
|
||||
<field name="model">crossovered.budget.lines</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Budget Lines">
|
||||
<field name="analytic_account_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_crossovered_budget_line_tree">
|
||||
<field name="name">crossovered.budget.line.tree</field>
|
||||
<field name="model">crossovered.budget.lines</field>
|
||||
|
||||
@@ -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:35+0000\n"
|
||||
"PO-Revision-Date: 2012-02-09 19:28+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:09+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@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-30 05:36+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
@@ -154,7 +154,7 @@ msgstr "Compañías"
|
||||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Default Check Layout"
|
||||
msgstr ""
|
||||
msgstr "Comprobar formato por defecto"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:account.journal:0
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
# Lithuanian 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-11-16 06:33+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Lithuanian <lt@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-11-17 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16278)\n"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check on Top"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.actions.act_window,help:account_check_writing.action_write_check
|
||||
msgid ""
|
||||
"The check payment form allows you to track the payment you do to your "
|
||||
"suppliers specially by check. When you select a supplier, the payment method "
|
||||
"and an amount for the payment, OpenERP will propose to reconcile your "
|
||||
"payment with the open supplier invoices or bills.You can print the check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:account.voucher:0
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle
|
||||
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top
|
||||
msgid "Print Check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check in middle"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: help:res.company,check_layout:0
|
||||
msgid ""
|
||||
"Check on top is compatible with Quicken, QuickBooks and Microsoft Money. "
|
||||
"Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on "
|
||||
"bottom is compatible with Peachtree, ACCPAC and DacEasy only"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: selection:res.company,check_layout:0
|
||||
msgid "Check on bottom"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:res.company:0
|
||||
msgid "Error! You can not create recursive companies."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: help:account.journal,allow_check_writing:0
|
||||
msgid "Check this if the journal is to be used for writing checks."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.journal,allow_check_writing:0
|
||||
msgid "Allow Check writing"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Description"
|
||||
msgstr "Aprašas"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_account_journal
|
||||
msgid "Journal"
|
||||
msgstr "Žurnalas"
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.actions.act_window,name:account_check_writing.action_write_check
|
||||
#: model:ir.ui.menu,name:account_check_writing.menu_action_write_check
|
||||
msgid "Write Checks"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Original Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.voucher,allow_check:0
|
||||
msgid "Allow Check Writing"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Payment"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.journal,use_preprint_check:0
|
||||
msgid "Use Preprinted Check"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:res.company:0
|
||||
msgid "The company name must be unique !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Due Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: view:res.company:0
|
||||
msgid "Default Check Layout"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: constraint:account.journal:0
|
||||
msgid ""
|
||||
"Configuration error! The currency chosen should be shared by the default "
|
||||
"accounts too."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
msgid "Balance Due"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.bottom:0
|
||||
#: report:account.print.check.middle:0
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Check Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: model:ir.model,name:account_check_writing.model_account_voucher
|
||||
msgid "Accounting Voucher"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The name of the journal must be unique per company !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: sql_constraint:account.journal:0
|
||||
msgid "The code of the journal must be unique per company !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:account.voucher,amount_in_word:0
|
||||
msgid "Amount in Word"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: report:account.print.check.top:0
|
||||
msgid "Open Balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_check_writing
|
||||
#: field:res.company,check_layout:0
|
||||
msgid "Choose Check layout"
|
||||
msgstr ""
|
||||
@@ -43,6 +43,18 @@
|
||||
<field eval="True" name="required"/>
|
||||
<field eval="2" name="sequence"/>
|
||||
</record>
|
||||
<record id="sequence_journal" model="ir.sequence.type">
|
||||
<field name="name">Account Journal</field>
|
||||
<field name="code">account.journal</field>
|
||||
</record>
|
||||
|
||||
<record id="sequence_journal_seq" model="ir.sequence">
|
||||
<field name="name">Account journal sequence</field>
|
||||
<field name="code">account.journal</field>
|
||||
<field name="prefix">AJ</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
</openerp>
|
||||
|
||||
@@ -267,6 +267,7 @@ class account_voucher(osv.osv):
|
||||
_order = "date desc, id desc"
|
||||
# _rec_name = 'number'
|
||||
_columns = {
|
||||
'active': fields.boolean('Active', help="By default, reconciliation vouchers made on draft bank statements are set as inactive, which allow to hide the customer/supplier payment while the bank statement isn't confirmed."),
|
||||
'type':fields.selection([
|
||||
('sale','Sale'),
|
||||
('purchase','Purchase'),
|
||||
@@ -328,6 +329,7 @@ class account_voucher(osv.osv):
|
||||
'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'),
|
||||
}
|
||||
_defaults = {
|
||||
'active': True,
|
||||
'period_id': _get_period,
|
||||
'partner_id': _get_partner,
|
||||
'journal_id':_get_journal,
|
||||
@@ -381,8 +383,9 @@ class account_voucher(osv.osv):
|
||||
total_tax = 0.0
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount', 0.0)
|
||||
for line in voucher.line_ids:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line.amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount', 0.0)
|
||||
total += total_tax
|
||||
else:
|
||||
for line in voucher.line_ids:
|
||||
@@ -413,31 +416,31 @@ class account_voucher(osv.osv):
|
||||
|
||||
line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context)
|
||||
|
||||
total_tax = 0.0
|
||||
for line in line_ids:
|
||||
line_amount = 0.0
|
||||
line_amount = line.get('amount',0.0)
|
||||
|
||||
if tax_id:
|
||||
tax = [tax_pool.browse(cr, uid, tax_id, context=context)]
|
||||
if partner_id:
|
||||
partner = partner_pool.browse(cr, uid, partner_id, context=context) or False
|
||||
taxes = position_pool.map_tax(cr, uid, partner and partner.property_account_position or False, tax)
|
||||
tax = tax_pool.browse(cr, uid, taxes, context=context)
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line_amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount')
|
||||
|
||||
voucher_total += line_amount
|
||||
|
||||
total = voucher_total
|
||||
total_tax = 0.0
|
||||
if tax_id:
|
||||
tax = [tax_pool.browse(cr, uid, tax_id, context=context)]
|
||||
if partner_id:
|
||||
partner = partner_pool.browse(cr, uid, partner_id, context=context) or False
|
||||
taxes = position_pool.map_tax(cr, uid, partner and partner.property_account_position or False, tax)
|
||||
tax = tax_pool.browse(cr, uid, taxes, context=context)
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_total, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount')
|
||||
total += total_tax
|
||||
total = voucher_total + total_tax
|
||||
|
||||
res.update({
|
||||
'amount':total or voucher_total,
|
||||
'tax_amount':total_tax
|
||||
'amount': total or voucher_total,
|
||||
'tax_amount': total_tax
|
||||
})
|
||||
return {
|
||||
'value':res
|
||||
'value': res
|
||||
}
|
||||
|
||||
def onchange_term_id(self, cr, uid, ids, term_id, amount):
|
||||
@@ -953,6 +956,9 @@ class account_voucher(osv.osv):
|
||||
if voucher_brw.number:
|
||||
name = voucher_brw.number
|
||||
elif voucher_brw.journal_id.sequence_id:
|
||||
if not voucher_brw.journal_id.sequence_id.active:
|
||||
raise osv.except_osv(_('Configuration Error !'),
|
||||
_('Please activate the sequence of selected journal !'))
|
||||
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error!'),
|
||||
@@ -1504,6 +1510,15 @@ account_voucher_line()
|
||||
class account_bank_statement(osv.osv):
|
||||
_inherit = 'account.bank.statement'
|
||||
|
||||
def button_confirm_bank(self, cr, uid, ids, context=None):
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
voucher_ids = []
|
||||
for statement in self.browse(cr, uid, ids, context=context):
|
||||
voucher_ids += [line.voucher_id.id for line in statement.line_ids if line.voucher_id]
|
||||
if voucher_ids:
|
||||
voucher_obj.write(cr, uid, voucher_ids, {'active': True}, context=context)
|
||||
return super(account_bank_statement, self).button_confirm_bank(cr, uid, ids, context=context)
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context=None):
|
||||
voucher_obj = self.pool.get('account.voucher')
|
||||
for st in self.browse(cr, uid, ids, context=context):
|
||||
@@ -1539,6 +1554,16 @@ account_bank_statement()
|
||||
class account_bank_statement_line(osv.osv):
|
||||
_inherit = 'account.bank.statement.line'
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
|
||||
res = super(account_bank_statement_line, self).onchange_partner_id(cr, uid, ids, partner_id, context=context)
|
||||
if 'value' not in res:
|
||||
res['value'] = {}
|
||||
res['value'].update({'voucher_id' : False})
|
||||
return res
|
||||
|
||||
def onchange_amount(self, cr, uid, ids, amount, context=None):
|
||||
return {'value' : {'voucher_id' : False}}
|
||||
|
||||
def _amount_reconciled(self, cursor, user, ids, name, args, context=None):
|
||||
if not ids:
|
||||
return {}
|
||||
@@ -1565,7 +1590,7 @@ class account_bank_statement_line(osv.osv):
|
||||
_columns = {
|
||||
'amount_reconciled': fields.function(_amount_reconciled,
|
||||
string='Amount reconciled', type='float'),
|
||||
'voucher_id': fields.many2one('account.voucher', 'Payment'),
|
||||
'voucher_id': fields.many2one('account.voucher', 'Reconciliation'),
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">eInvoicing & Payments application installed!</field>
|
||||
<field name="body"><![CDATA[
|
||||
OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.
|
||||
|
||||
<p>You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.</p>
|
||||
]]></field>
|
||||
<field name="body"><![CDATA[<p>OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system.</p>
|
||||
<p>You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. For advanced accounting features, you should install the "Accounting and Finance" module.</p>]]></field>
|
||||
</record>
|
||||
|
||||
<!-- mail: subtypes -->
|
||||
|
||||
@@ -200,33 +200,29 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='import_buttons']" position="inside">
|
||||
<button name="%(action_view_account_statement_from_invoice_lines)d"
|
||||
string="Import Invoices" type="action" icon="gtk-execute"
|
||||
string="Import Invoices" type="action"
|
||||
attrs="{'invisible':[('state','=','confirm')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_tree_voucher" model="ir.ui.view">
|
||||
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.voucher.tree.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
|
||||
<field name="voucher_id" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
|
||||
<field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
|
||||
<field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False}"/>
|
||||
</xpath>
|
||||
<field name="amount" position="attributes">
|
||||
<attribute name="on_change">onchange_amount(amount)</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_form_voucher" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.voucher.form.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
|
||||
<field name="voucher_id" context="{'line_type': type, 'default_type': amount < 0 and 'payment' or 'receipt', 'type': amount < 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_cash_statement_tree_voucher" model="ir.ui.view">
|
||||
<field name="name">account.cash.statement.voucher.tree.inherit</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
|
||||
@@ -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:01+0000\n"
|
||||
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-11-17 09:57+0000\n"
|
||||
"Last-Translator: Stefan Rijnhart (Therp) <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-30 05:19+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-18 04:37+0000\n"
|
||||
"X-Generator: Launchpad (build 16278)\n"
|
||||
|
||||
#. module: account_voucher
|
||||
#: view:sale.receipt.report:0
|
||||
@@ -846,7 +846,7 @@ msgstr ""
|
||||
#: view:account.voucher:0
|
||||
#: model:ir.model,name:account_voucher.model_account_voucher
|
||||
msgid "Accounting Voucher"
|
||||
msgstr "Betalingsintentie"
|
||||
msgstr "Journaalbon"
|
||||
|
||||
#. module: account_voucher
|
||||
#: field:account.voucher,number:0
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
<form string="Bill Payment" version="7.0">
|
||||
<group col="6">
|
||||
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1, 'invoice_currency': currency_id}"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
@@ -390,35 +392,33 @@
|
||||
<field name="model">account.voucher</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Receipt" version="7.0">
|
||||
<header>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)" class="oe_highlight"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma" invisible="context.get('line_type', False)"/>
|
||||
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" invisible="context.get('line_type', False)" confirm="Are you sure to unreconcile and cancel this record ?"/>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" invisible="context.get('line_type', False)"/>
|
||||
<header invisible="context.get('line_type', False)">
|
||||
<button name="proforma_voucher" string="Validate" states="draft" class="oe_highlight"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma"/>
|
||||
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" confirm="Are you sure to unreconcile and cancel this record ?"/>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
<h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
|
||||
<group>
|
||||
<group invisible="context.get('line_type', False)">
|
||||
<group>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
|
||||
<field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="amount" class="oe_inline"
|
||||
string="Paid Amount"
|
||||
widget="monetary" options="{'currency_field': 'currency_id'}"
|
||||
invisible="context.get('line_type', False)"
|
||||
on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
|
||||
<field name="journal_id"
|
||||
domain="[('type','in',['bank', 'cash'])]"
|
||||
invisible="context.get('line_type', False)"
|
||||
widget="selection"
|
||||
on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
|
||||
string="Payment Method"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
|
||||
<field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
|
||||
<field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
|
||||
<field name="reference" string="Payment Ref" placeholder="e.g. 003/10"/>
|
||||
<field name="name" colspan="2" placeholder="e.g. Invoice SAJ/0042"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
||||
<field name="account_id"
|
||||
@@ -430,7 +430,7 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Payment Information" groups="base.group_user">
|
||||
<label for="line_cr_ids"/>
|
||||
<label for="line_cr_ids" invisible="context.get('line_type', False)"/>
|
||||
<field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
|
||||
<tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
|
||||
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
|
||||
@@ -511,7 +511,7 @@
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<div class="oe_chatter" invisible="context.get('line_type', False)">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<field name="res_model">account.voucher</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[('journal_id.type', 'in', ['bank', 'cash']), ('type','=','receipt'), ('partner_id','=',partner_id)]</field>
|
||||
<field name="context">{'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="context">{'default_type':'receipt', 'type':'receipt', 'partner_id': partner_id, 'default_reference':reference}</field>
|
||||
<field name="view_id" ref="view_vendor_receipt_form"/>
|
||||
<field name="target">current</field>
|
||||
</record>
|
||||
|
||||
@@ -98,6 +98,10 @@ class account_analytic_account(osv.osv):
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
if not ids:
|
||||
return res
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for id in ids:
|
||||
elmt = self.browse(cr, uid, id, context=context)
|
||||
res.append((id, self._get_one_full_name(elmt)))
|
||||
@@ -323,7 +327,7 @@ class account_analytic_line(osv.osv):
|
||||
'date': fields.date('Date', required=True, select=True),
|
||||
'amount': fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price. Always expressed in the company main currency.', digits_compute=dp.get_precision('Account')),
|
||||
'unit_amount': fields.float('Quantity', help='Specifies the amount of quantity to count.'),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True, domain=[('type','<>','view')]),
|
||||
'account_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='restrict', select=True, domain=[('type','<>','view')]),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ access_ir_model_fields_anonymization_group_system,ir_model_fields_anonymization
|
||||
access_ir_model_fields_anonymization_user,ir_model_fields_anonymization user,model_ir_model_fields_anonymization,,1,0,0,0
|
||||
access_ir_model_fields_anonymization_history_group_system,ir_model_fields_anonymization_history group_user,model_ir_model_fields_anonymization_history,base.group_system,1,1,1,1
|
||||
access_ir_model_fields_anonymization_history_user,ir_model_fields_anonymization_history user,model_ir_model_fields_anonymization_history,,1,0,0,0
|
||||
access_ir_model_fields_anonymization_migration_fix,access_ir_model_fields_anonymization_migration_fix,model_ir_model_fields_anonymization_migration_fix,,1,1,1,1
|
||||
|
||||
|
@@ -346,8 +346,13 @@ class audittrail_objects_proxy(object_proxy):
|
||||
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
|
||||
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
|
||||
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
|
||||
#recursive call on x2m fields that need to be checked too
|
||||
data.update(self.get_data(cr, SUPERUSER_ID, pool, resource[field], x2m_model, method))
|
||||
field_resource_ids = list(set(resource[field]))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in field_resource_ids:
|
||||
field_resource_ids.remove(resource_id)
|
||||
data.update(self.get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
|
||||
|
||||
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
|
||||
return data
|
||||
|
||||
@@ -388,6 +393,8 @@ class audittrail_objects_proxy(object_proxy):
|
||||
}
|
||||
# loop on all the fields
|
||||
for field_name, field_definition in pool.get(model.model)._all_columns.items():
|
||||
if field_name in ('__last_update', 'id'):
|
||||
continue
|
||||
#if the field_list param is given, skip all the fields not in that list
|
||||
if field_list and field_name not in field_list:
|
||||
continue
|
||||
@@ -406,6 +413,10 @@ class audittrail_objects_proxy(object_proxy):
|
||||
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
|
||||
# We use list(set(...)) to remove duplicates.
|
||||
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
|
||||
if model.model == x2m_model.model:
|
||||
# we need to remove current resource_id from the many2many to prevent an infinit loop
|
||||
if resource_id in res_ids:
|
||||
res_ids.remove(resource_id)
|
||||
for res_id in res_ids:
|
||||
lines.update(self.prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
|
||||
# if the value value is different than the old value: record the change
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="object_id" readonly="1"/>
|
||||
</group>
|
||||
<field name="line_ids" mode="tree,form"
|
||||
<field name="line_ids" mode="tree"
|
||||
widget="one2many_list" readonly="1">
|
||||
<form string="Log Lines" version="7.0">
|
||||
<group col="4">
|
||||
|
||||
@@ -4,11 +4,11 @@ openerp.auth_anonymous = function(instance) {
|
||||
start: function() {
|
||||
var self = this;
|
||||
return $.when(this._super()).then(function() {
|
||||
var dblist = self._db_list || [];
|
||||
var dblist = self.db_list || [];
|
||||
if (!self.session.session_is_valid() && dblist.length === 1) {
|
||||
self.remember_credentials = false;
|
||||
// XXX get login/pass from server (via a rpc call) ?
|
||||
return self.do_login(dblist[0], 'anonymous', 'anonymous')
|
||||
return self.do_login(dblist[0], 'anonymous', 'anonymous');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,48 +1,101 @@
|
||||
import functools
|
||||
import logging
|
||||
|
||||
import simplejson
|
||||
import werkzeug.urls
|
||||
import werkzeug.utils
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
import openerp
|
||||
from openerp import SUPERUSER_ID
|
||||
import openerp.addons.web.http as oeweb
|
||||
from openerp.addons.web.controllers.main import db_monodb, set_cookie_and_redirect, login_and_redirect
|
||||
from openerp.modules.registry import RegistryManager
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class OAuthController(openerp.addons.web.http.Controller):
|
||||
#----------------------------------------------------------
|
||||
# helpers
|
||||
#----------------------------------------------------------
|
||||
def fragment_to_query_string(func):
|
||||
@functools.wraps(func)
|
||||
def wrapper(self, req, **kw):
|
||||
if not kw:
|
||||
return """<html><head><script>
|
||||
var l = window.location;
|
||||
var q = l.hash.substring(1);
|
||||
var r = '/' + l.search;
|
||||
if(q.length !== 0) {
|
||||
var s = l.search ? (l.search === '?' ? '' : '&') : '?';
|
||||
r = l.pathname + l.search + s + q;
|
||||
}
|
||||
window.location = r;
|
||||
</script></head><body></body></html>"""
|
||||
return func(self, req, **kw)
|
||||
return wrapper
|
||||
|
||||
|
||||
#----------------------------------------------------------
|
||||
# Controller
|
||||
#----------------------------------------------------------
|
||||
class OAuthController(oeweb.Controller):
|
||||
_cp_path = '/auth_oauth'
|
||||
|
||||
@openerp.addons.web.http.jsonrequest
|
||||
@oeweb.jsonrequest
|
||||
def list_providers(self, req, dbname):
|
||||
try:
|
||||
registry = openerp.modules.registry.RegistryManager.get(dbname)
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
providers = registry.get('auth.oauth.provider')
|
||||
l = providers.read(cr, openerp.SUPERUSER_ID, providers.search(cr, openerp.SUPERUSER_ID, [('enabled','=',True)]))
|
||||
l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True)]))
|
||||
except Exception:
|
||||
l = []
|
||||
return l
|
||||
|
||||
@openerp.addons.web.http.httprequest
|
||||
@oeweb.httprequest
|
||||
@fragment_to_query_string
|
||||
def signin(self, req, **kw):
|
||||
state = simplejson.loads(kw['state'])
|
||||
dbname = state['d']
|
||||
provider = state['p']
|
||||
registry = openerp.modules.registry.RegistryManager.get(dbname)
|
||||
context = state.get('c', {})
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
try:
|
||||
u = registry.get('res.users')
|
||||
credentials = u.auth_oauth(cr, openerp.SUPERUSER_ID, provider, kw)
|
||||
credentials = u.auth_oauth(cr, SUPERUSER_ID, provider, kw, context=context)
|
||||
cr.commit()
|
||||
return openerp.addons.web.controllers.main.login_and_redirect(req, *credentials)
|
||||
return login_and_redirect(req, *credentials)
|
||||
except AttributeError:
|
||||
# auth_signup is not installed
|
||||
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled."%dbname)
|
||||
_logger.error("auth_signup not installed on database %s: oauth sign up cancelled." % (dbname,))
|
||||
url = "/#action=login&oauth_error=1"
|
||||
except Exception,e:
|
||||
except Exception, e:
|
||||
# signup error
|
||||
_logger.exception("OAuth2: %s" % str(e))
|
||||
url = "/#action=login&oauth_error=2"
|
||||
return openerp.addons.web.controllers.main.set_cookie_and_redirect(req, url)
|
||||
|
||||
return set_cookie_and_redirect(req, url)
|
||||
|
||||
@oeweb.httprequest
|
||||
def oea(self, req, **kw):
|
||||
"""login user via OpenERP Account provider"""
|
||||
dbname = kw.pop('db', None)
|
||||
if not dbname:
|
||||
dbname = db_monodb(req)
|
||||
if not dbname:
|
||||
return BadRequest()
|
||||
|
||||
registry = RegistryManager.get(dbname)
|
||||
with registry.cursor() as cr:
|
||||
IMD = registry['ir.model.data']
|
||||
model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
|
||||
assert model == 'auth.oauth.provider'
|
||||
|
||||
state = {
|
||||
'd': dbname,
|
||||
'p': provider_id,
|
||||
'c': {'no_user_creation': True},
|
||||
}
|
||||
|
||||
kw['state'] = simplejson.dumps(state)
|
||||
return self.signin(req, **kw)
|
||||
|
||||
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -24,7 +24,7 @@ class res_users(osv.Model):
|
||||
('uniq_users_oauth_provider_oauth_uid', 'unique(oauth_provider_id, oauth_uid)', 'OAuth UID must be unique per provider'),
|
||||
]
|
||||
|
||||
def auth_oauth_rpc(self, cr, uid, endpoint, access_token, context=None):
|
||||
def _auth_oauth_rpc(self, cr, uid, endpoint, access_token, context=None):
|
||||
params = urllib.urlencode({'access_token': access_token})
|
||||
if urlparse.urlparse(endpoint)[4]:
|
||||
url = endpoint + '&' + params
|
||||
@@ -34,6 +34,17 @@ class res_users(osv.Model):
|
||||
response = f.read()
|
||||
return simplejson.loads(response)
|
||||
|
||||
def _auth_oauth_validate(self, cr, uid, provider, access_token, context=None):
|
||||
""" return the validation data corresponding to the access token """
|
||||
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
||||
validation = self._auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
|
||||
if validation.get("error"):
|
||||
raise Exception(validation['error'])
|
||||
if p.data_endpoint:
|
||||
data = self._auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
|
||||
validation.update(data)
|
||||
return validation
|
||||
|
||||
def auth_oauth(self, cr, uid, provider, params, context=None):
|
||||
# Advice by Google (to avoid Confused Deputy Problem)
|
||||
# if validation.audience != OUR_CLIENT_ID:
|
||||
@@ -41,25 +52,21 @@ class res_users(osv.Model):
|
||||
# else:
|
||||
# continue with the process
|
||||
access_token = params.get('access_token')
|
||||
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
||||
|
||||
validation = self.auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
|
||||
if validation.get("error"):
|
||||
raise Exception(validation['error'])
|
||||
if p.data_endpoint:
|
||||
data = self.auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
|
||||
validation.update(data)
|
||||
validation = self._auth_oauth_validate(cr, uid, provider, access_token)
|
||||
# required
|
||||
oauth_uid = validation['user_id']
|
||||
if not oauth_uid:
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
email = validation.get('email', 'provider_%d_user_%d' % (p.id, oauth_uid))
|
||||
email = validation.get('email', 'provider_%d_user_%d' % (provider, oauth_uid))
|
||||
login = email
|
||||
# optional
|
||||
name = validation.get('name', email)
|
||||
res = self.search(cr, uid, [("oauth_uid", "=", oauth_uid), ('oauth_provider_id', '=', provider)])
|
||||
if res:
|
||||
assert len(res) == 1
|
||||
self.write(cr, uid, res[0], {'oauth_access_token': access_token})
|
||||
user = self.browse(cr, uid, res[0], context=context)
|
||||
login = user.login
|
||||
user.write({'oauth_access_token': access_token})
|
||||
else:
|
||||
# New user if signup module available
|
||||
if not hasattr(self, '_signup_create_user'):
|
||||
@@ -67,9 +74,9 @@ class res_users(osv.Model):
|
||||
|
||||
new_user = {
|
||||
'name': name,
|
||||
'login': email,
|
||||
'login': login,
|
||||
'user_email': email,
|
||||
'oauth_provider_id': p.id,
|
||||
'oauth_provider_id': provider,
|
||||
'oauth_uid': oauth_uid,
|
||||
'oauth_access_token': access_token,
|
||||
'active': True,
|
||||
@@ -77,7 +84,7 @@ class res_users(osv.Model):
|
||||
# TODO pass signup token to allow attach new user to right partner
|
||||
self._signup_create_user(cr, uid, new_user)
|
||||
|
||||
credentials = (cr.dbname, email, access_token)
|
||||
credentials = (cr.dbname, login, access_token)
|
||||
return credentials
|
||||
|
||||
def check_credentials(self, cr, uid, password):
|
||||
|
||||
@@ -36,7 +36,10 @@ openerp.auth_oauth = function(instance) {
|
||||
ev.preventDefault();
|
||||
var index = $(ev.target).data('index');
|
||||
var p = this.oauth_providers[index];
|
||||
var ret = location.protocol+"//"+location.host+"/";
|
||||
var ret = _.str.sprintf('%s//%s/auth_oauth/signin', location.protocol, location.host);
|
||||
if (instance.session.debug) {
|
||||
ret += '?debug';
|
||||
}
|
||||
var dbname = self.$("form [name=db]").val();
|
||||
var state_object = {
|
||||
d: dbname,
|
||||
@@ -55,16 +58,4 @@ openerp.auth_oauth = function(instance) {
|
||||
},
|
||||
});
|
||||
|
||||
instance.web.WebClient = instance.web.WebClient.extend({
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
var params = $.deparam(window.location.hash.substring(1));
|
||||
// alert(JSON.stringify(params));
|
||||
if (params.hasOwnProperty('access_token')) {
|
||||
var url = "/auth_oauth/signin" + '?' + $.param(params);
|
||||
window.location = url;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ openerp.auth_signup = function(instance) {
|
||||
on_token_loaded: function(result) {
|
||||
// select the right the database
|
||||
this.selected_db = result.db;
|
||||
this.on_db_loaded({db_list: [result.db]});
|
||||
this.on_db_loaded([result.db]);
|
||||
if (result.token) {
|
||||
// switch to signup mode, set user name and login
|
||||
this.$el.addClass("oe_login_signup");
|
||||
@@ -80,16 +80,16 @@ openerp.auth_signup = function(instance) {
|
||||
this.do_warn("Login", "No database selected !");
|
||||
return false;
|
||||
} else if (!name) {
|
||||
this.do_warn("Login", "Please enter a name.")
|
||||
this.do_warn("Login", "Please enter a name.");
|
||||
return false;
|
||||
} else if (!login) {
|
||||
this.do_warn("Login", "Please enter a username.")
|
||||
this.do_warn("Login", "Please enter a username.");
|
||||
return false;
|
||||
} else if (!password || !confirm_password) {
|
||||
this.do_warn("Login", "Please enter a password and confirm it.")
|
||||
this.do_warn("Login", "Please enter a password and confirm it.");
|
||||
return false;
|
||||
} else if (password !== confirm_password) {
|
||||
this.do_warn("Login", "Passwords do not match; please retype them.")
|
||||
this.do_warn("Login", "Passwords do not match; please retype them.");
|
||||
return false;
|
||||
}
|
||||
var params = {
|
||||
|
||||
@@ -8,15 +8,14 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-05-10 17:24+0000\n"
|
||||
"Last-Translator: Jordi Esteve (www.zikzakmedia.com) "
|
||||
"<jesteve@zikzakmedia.com>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:09+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@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-30 05:32+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: help:base.action.rule,act_mail_to_user:0
|
||||
@@ -340,7 +339,7 @@ msgstr "Activo"
|
||||
#: code:addons/base_action_rule/base_action_rule.py:329
|
||||
#, python-format
|
||||
msgid "No Email ID Found for your Company address!"
|
||||
msgstr ""
|
||||
msgstr "¡No se ha encontrado Id del e-mail para la dirección de su compañía!"
|
||||
|
||||
#. module: base_action_rule
|
||||
#: field:base.action.rule,act_remind_user:0
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a message..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -19,19 +19,24 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
import logging
|
||||
import re
|
||||
import time
|
||||
|
||||
from openerp.osv import osv, fields
|
||||
from openerp import tools
|
||||
from openerp.tools.translate import _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from mygengo import MyGengo
|
||||
except ImportError:
|
||||
raise osv.except_osv(_('Gengo ImportError'), _('Please install mygengo lib from http://pypi.python.org/pypi/mygengo'))
|
||||
|
||||
import logging
|
||||
import tools
|
||||
import time
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
_logger.warning('Gengo library not found, Gengo features disabled. If you plan to use it, please install the mygengo library from http://pypi.python.org/pypi/mygengo')
|
||||
class MyGengo(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
# no context for translations - so don't bother
|
||||
raise ImportError('Gengo library not found, please install mygengo from http://pypi.python.org/pypi/mygengo')
|
||||
|
||||
GENGO_DEFAULT_LIMIT = 20
|
||||
|
||||
@@ -48,7 +53,7 @@ class base_gengo_translations(osv.osv_memory):
|
||||
_name = 'base.gengo.translations'
|
||||
_columns = {
|
||||
'restart_send_job': fields.boolean("Restart Sending Job"),
|
||||
'lang_id': fields.many2one('res.lang', 'Language', help="Leave empty if you don't want to restrict the request to a single language"),
|
||||
'lang_id': fields.many2one('res.lang', 'Language', required=True),
|
||||
}
|
||||
|
||||
def gengo_authentication(self, cr, uid, context=None):
|
||||
@@ -62,21 +67,19 @@ class base_gengo_translations(osv.osv_memory):
|
||||
by the cron) or in a dialog box (if requested by the user), thus it's important to return it
|
||||
translated.
|
||||
'''
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
if not user.company_id.gengo_public_key or not user.company_id.gengo_private_key:
|
||||
return (False, _("Invalid Gengo configuration. Gengo authentication `Public Key` or `Private Key` is missing. Complete Gengo authentication parameters under `Settings > Companies > Gengo Parameters`."))
|
||||
return (False, _("Gengo `Public Key` or `Private Key` are missing. Enter your Gengo authentication parameters under `Settings > Companies > Gengo Parameters`."))
|
||||
try:
|
||||
gengo = MyGengo(
|
||||
public_key=user.company_id.gengo_public_key.encode('ascii'),
|
||||
private_key=user.company_id.gengo_private_key.encode('ascii'),
|
||||
sandbox=True,
|
||||
)
|
||||
gengo.getAccountStats()
|
||||
|
||||
return (True, gengo)
|
||||
except Exception, e:
|
||||
return (False, _("Gengo Connection Error\n%s") %e)
|
||||
_logger.exception('Gengo connection failed')
|
||||
return (False, _("Gengo connection failed with this message:\n``%s``") % e)
|
||||
|
||||
def do_check_schedular(self, cr, uid, xml_id, name, fn, context=None):
|
||||
"""
|
||||
@@ -87,7 +90,7 @@ class base_gengo_translations(osv.osv_memory):
|
||||
cron_vals.update({'name': name, "function": fn})
|
||||
try:
|
||||
res = []
|
||||
model, res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base_gengo', xml_id)
|
||||
_, res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base_gengo', xml_id)
|
||||
cron_pool.write(cr, uid, [res], cron_vals, context=context)
|
||||
except:
|
||||
#the cron job was not found, probably deleted previously, so we create it again using default values
|
||||
@@ -108,7 +111,7 @@ class base_gengo_translations(osv.osv_memory):
|
||||
supported_langs = self.pool.get('ir.translation')._get_all_supported_languages(cr, uid, context=context)
|
||||
language = self.pool.get('ir.translation')._get_gengo_corresponding_language(wizard.lang_id.code)
|
||||
if language not in supported_langs:
|
||||
raise osv.except_osv(_("Warning"), _('This language is not supported by the Gengo translation services.'))
|
||||
raise osv.except_osv(_("Warning"), _('This language is not supported by the Gengo translation services.'))
|
||||
|
||||
#send immediately a new request for the selected language (if any)
|
||||
ctx = context.copy()
|
||||
@@ -207,8 +210,6 @@ class base_gengo_translations(osv.osv_memory):
|
||||
Send a request to Gengo with all the term_ids in a different job, get the response and update the terms in
|
||||
database accordingly.
|
||||
"""
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
flag, gengo = self.gengo_authentication(cr, uid, context=context)
|
||||
if flag:
|
||||
request = self.pack_jobs_request(cr, uid, term_ids, context=context)
|
||||
|
||||
@@ -6,14 +6,9 @@
|
||||
<field name="model">base.gengo.translations</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Gengo Request Form" version="7.0">
|
||||
<group col="4">
|
||||
<group>
|
||||
<field name="lang_id" required="1"/>
|
||||
<field name="restart_send_job"/>
|
||||
</group>
|
||||
<group>
|
||||
<label colspan="2" string="Leave empty for requesting all the terms to Gengo that needs it, regardless of their language"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="lang_id"/>
|
||||
<field name="restart_send_job"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="act_update" string="Send" type="object" class="oe_highlight"/>
|
||||
|
||||
@@ -99,6 +99,8 @@ class res_partner_bank(osv.osv):
|
||||
@param iban: IBAN as string
|
||||
@return: True if IBAN is valid, False otherwise
|
||||
"""
|
||||
if not iban:
|
||||
return False
|
||||
iban = _format_iban(iban).lower()
|
||||
if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])):
|
||||
return False
|
||||
@@ -128,9 +130,9 @@ class res_partner_bank(osv.osv):
|
||||
def _construct_constraint_msg(self, cr, uid, ids, context=None):
|
||||
|
||||
def default_iban_check(iban_cn):
|
||||
return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
|
||||
return iban_cn and iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
|
||||
|
||||
iban_country = self.browse(cr, uid, ids)[0].acc_number[:2].lower()
|
||||
iban_country = self.browse(cr, uid, ids)[0].acc_number and self.browse(cr, uid, ids)[0].acc_number[:2].lower()
|
||||
if default_iban_check(iban_country):
|
||||
if iban_country in _ref_iban:
|
||||
return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \
|
||||
|
||||
@@ -24,9 +24,12 @@ Re-implement openerp's file import system:
|
||||
'category': 'Uncategorized',
|
||||
'website': 'http://www.openerp.com',
|
||||
'author': 'OpenERP SA',
|
||||
'depends': ['base'],
|
||||
'depends': ['web'],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'css': [
|
||||
'static/lib/select2/select2.css',
|
||||
'static/src/css/import.css',
|
||||
@@ -37,4 +40,5 @@ Re-implement openerp's file import system:
|
||||
'static/src/js/import.js',
|
||||
],
|
||||
'qweb': ['static/src/xml/import.xml'],
|
||||
'test': ['static/test/states.js'],
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
$(document).ready(function () {
|
||||
module('foo');
|
||||
test('dummy', function () {
|
||||
ok(42);
|
||||
});
|
||||
});
|
||||
@@ -44,7 +44,6 @@ Shows you a list of applications features to install from.
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'images': ['images/base_setup1.jpeg','images/base_setup2.jpeg','images/base_setup3.jpeg','images/base_setup4.jpeg',],
|
||||
'js': ['static/src/js/base_setup.js'],
|
||||
'css': ['static/src/css/base_setup.css'],
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -224,8 +224,6 @@ class base_stage(object):
|
||||
cases = self.browse(cr, uid, ids, context=context)
|
||||
for case in cases:
|
||||
data = {'active': True}
|
||||
if case.stage_id and case.stage_id.state == 'draft':
|
||||
data['date_open'] = fields.datetime.now()
|
||||
if not case.user_id:
|
||||
data['user_id'] = uid
|
||||
self.case_set(cr, uid, [case.id], 'open', data, context=context)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# Hungarian 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: 2011-01-11 11:14+0000\n"
|
||||
"PO-Revision-Date: 2012-11-13 16:00+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Hungarian <hu@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-11-14 04:40+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: base_tools
|
||||
#: model:ir.module.module,shortdesc:base_tools.module_meta_information
|
||||
msgid "Common base for tools modules"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_tools
|
||||
#: model:ir.module.module,description:base_tools.module_meta_information
|
||||
msgid ""
|
||||
"\n"
|
||||
" "
|
||||
msgstr ""
|
||||
@@ -0,0 +1,23 @@
|
||||
# Lithuanian 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-11-15 13:45+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Lithuanian <lt@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-11-16 04:36+0000\n"
|
||||
"X-Generator: Launchpad (build 16272)\n"
|
||||
|
||||
#. module: claim_from_delivery
|
||||
#: model:ir.actions.act_window,name:claim_from_delivery.action_claim_from_delivery
|
||||
msgid "Claim"
|
||||
msgstr ""
|
||||
@@ -115,7 +115,6 @@ class crm_case_section(osv.osv):
|
||||
'code': fields.char('Code', size=8),
|
||||
'active': fields.boolean('Active', help="If the active field is set to "\
|
||||
"true, it will allow you to hide the sales team without removing it."),
|
||||
'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
|
||||
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
|
||||
'user_id': fields.many2one('res.users', 'Team Leader'),
|
||||
'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
|
||||
@@ -137,7 +136,6 @@ class crm_case_section(osv.osv):
|
||||
|
||||
_defaults = {
|
||||
'active': 1,
|
||||
'allow_unlink': 1,
|
||||
'stage_ids': _get_stage_common,
|
||||
'alias_domain': False, # always hide alias during creation
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class base_action_rule(osv.osv):
|
||||
write['section_id'] = action.act_section_id.id
|
||||
|
||||
if hasattr(action, 'act_categ_id') and action.act_categ_id:
|
||||
write['categ_ids'] = [4, action.act_categ_id.id]
|
||||
write['categ_ids'] = [(4, action.act_categ_id.id)]
|
||||
|
||||
model_obj.write(cr, uid, [obj.id], write, context)
|
||||
return res
|
||||
|
||||
@@ -58,9 +58,10 @@
|
||||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">CRM application installed!</field>
|
||||
<field name="body">From the top Sales menu you can track leads and opportunities, get accurate forecast on your sales pipeline, plan meetings and phonecalls, get realtime statistics and efficiently organize the communication with your prospects.
|
||||
To manage quotations and sale orders, install the "Sales Management" application.</field>
|
||||
<field name="body"><![CDATA[<p>From the top Sales menu you can track leads and opportunities, get accurate forecast on your sales pipeline, plan meetings and phonecalls, get realtime statistics and efficiently organize the communication with your prospects.</p>
|
||||
<p>To manage quotations and sale orders, install the "Sales Management" application.</p>]]></field>
|
||||
</record>
|
||||
|
||||
<record model="mail.alias" id="default_sales_alias">
|
||||
|
||||
+7
-16
@@ -50,7 +50,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
def _get_default_stage_id(self, cr, uid, context=None):
|
||||
""" Gives default stage_id """
|
||||
section_id = self._get_default_section_id(cr, uid, context=context)
|
||||
return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context)
|
||||
return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context)
|
||||
|
||||
def _resolve_section_id_from_context(self, cr, uid, context=None):
|
||||
""" Returns ID of section based on the value of 'section_id'
|
||||
@@ -224,11 +224,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
multi='day_close', type="float", store=True),
|
||||
'state': fields.related('stage_id', 'state', type="selection", store=True,
|
||||
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
|
||||
help='The Status is set to \'Draft\', when a case is created.\
|
||||
If the case is in progress the Status is set to \'Open\'.\
|
||||
When the case is over, the Status is set to \'Done\'.\
|
||||
If the case needs to be reviewed then the Status is \
|
||||
set to \'Pending\'.'),
|
||||
help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
|
||||
|
||||
# Only used for type opportunity
|
||||
'probability': fields.float('Success Rate (%)',group_operator="avg"),
|
||||
@@ -328,7 +324,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
cases = self.browse(cr, uid, ids2, context=context)
|
||||
return self._action(cr, uid, cases, False, context=context)
|
||||
|
||||
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
|
||||
def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None):
|
||||
""" Override of the base.stage method
|
||||
Parameter of the stage search taken from the lead:
|
||||
- type: stage type must be the same or 'both'
|
||||
@@ -341,6 +337,9 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
# collect all section_ids
|
||||
section_ids = []
|
||||
types = ['both']
|
||||
if not cases :
|
||||
type = context.get('default_type')
|
||||
types += [type]
|
||||
if section_id:
|
||||
section_ids.append(section_id)
|
||||
for lead in cases:
|
||||
@@ -779,14 +778,6 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
}
|
||||
return res
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
for lead in self.browse(cr, uid, ids, context):
|
||||
if (not lead.section_id.allow_unlink) and (lead.state != 'draft'):
|
||||
raise osv.except_osv(_('Error!'),
|
||||
_("You cannot delete lead '%s' because it is not in 'Draft' state. " \
|
||||
"You can still cancel it, instead of deleting it.") % lead.name)
|
||||
return super(crm_lead, self).unlink(cr, uid, ids, context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if vals.get('stage_id') and not vals.get('probability'):
|
||||
# change probability of lead(s) if required by stage
|
||||
@@ -841,7 +832,7 @@ class crm_lead(base_stage, format_address, osv.osv):
|
||||
}
|
||||
for line in msg.get('body', '').split('\n'):
|
||||
line = line.strip()
|
||||
res = tools.misc.command_re.match(line)
|
||||
res = tools.command_re.match(line)
|
||||
if res and maps.get(res.group(1).lower()):
|
||||
key = maps.get(res.group(1).lower())
|
||||
update_vals[key] = res.group(2).lower()
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<record id="action_crm_lead_unread" model="ir.values">
|
||||
<field name="name">action_crm_lead_unread</field>
|
||||
<field name="action_id" ref="actions_server_crm_lead_unread"/>
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))"/>
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_crm_lead" />
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
@@ -32,9 +32,9 @@
|
||||
<record id="action_crm_lead_read" model="ir.values">
|
||||
<field name="name">action_crm_lead_read</field>
|
||||
<field name="action_id" ref="actions_server_crm_lead_read"/>
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))" />
|
||||
<field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))"/>
|
||||
<field name="key">action</field>
|
||||
<field name="model_id" ref="model_crm_lead" />
|
||||
<field name="model_id" ref="model_crm_lead"/>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
</record>
|
||||
@@ -143,7 +143,7 @@
|
||||
<div class="oe_right oe_button_box" name="buttons">
|
||||
<button type="action"
|
||||
name="%(act_crm_opportunity_crm_phonecall_new)d"
|
||||
string="Phone Calls" />
|
||||
string="Phone Calls"/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only" string="Lead Description"/>
|
||||
@@ -167,13 +167,13 @@
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<label for="contact_name" />
|
||||
<label for="contact_name"/>
|
||||
<div>
|
||||
<field name="contact_name" class="oe_inline"/>,
|
||||
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
|
||||
</div>
|
||||
<field name="email_from" widget="email"/>
|
||||
<field name="function" />
|
||||
<field name="function"/>
|
||||
<field name="phone"/>
|
||||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
@@ -209,14 +209,14 @@
|
||||
<group string="Categorization">
|
||||
<field name="company_id"
|
||||
groups="base.group_multi_company"
|
||||
widget="selection" colspan="2" />
|
||||
widget="selection" colspan="2"/>
|
||||
<field name="type_id" widget="selection"/>
|
||||
<field name="channel_id" widget="selection"/>
|
||||
<field name="referred"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
</group>
|
||||
<group string="Mailings">
|
||||
<field name="opt_out" />
|
||||
<field name="opt_out"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -253,12 +253,12 @@
|
||||
<field name="create_date" groups="base.group_no_one"/>
|
||||
<field name="name"/>
|
||||
<field name="contact_name"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)" />
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)"/>
|
||||
<field name="email_from"/>
|
||||
<field name="phone"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="section_id" invisible="context.get('invisible_section', True)" />
|
||||
<field name="section_id" invisible="context.get('invisible_section', True)"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="referred" invisible="1"/>
|
||||
@@ -276,8 +276,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Leads Generation"
|
||||
date_start="date_action" color="user_id">
|
||||
<field name="name" />
|
||||
<field name="partner_name" />
|
||||
<field name="name"/>
|
||||
<field name="partner_name"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
@@ -354,14 +354,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Leads">
|
||||
<field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
|
||||
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]" />
|
||||
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
|
||||
<field name="create_date"/>
|
||||
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||
<separator/>
|
||||
<filter icon="terp-check" string="New" name="new" help="New Leads" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-camera_test" string="In Progress" name="open" domain="[('state','=','open')]"/>
|
||||
<separator/>
|
||||
<filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads" />
|
||||
<filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads"/>
|
||||
<separator/>
|
||||
<filter string="Leads Assigned to Me or My Team(s)" icon="terp-personal+" context="{'invisible_section': False}"
|
||||
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
|
||||
@@ -373,8 +373,8 @@
|
||||
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
|
||||
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
|
||||
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}" />
|
||||
<filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
|
||||
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Creation" help="Create date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
|
||||
@@ -415,7 +415,7 @@
|
||||
name="action_makeMeeting"
|
||||
type="object"
|
||||
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
@@ -452,7 +452,7 @@
|
||||
<label for="section_id"/>
|
||||
<div>
|
||||
<field name="section_id" widget="selection"/>
|
||||
<button name="case_escalate" string="Escalate" type="object" states="draft,open,pending" />
|
||||
<button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
@@ -485,12 +485,12 @@
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<label for="contact_name" />
|
||||
<label for="contact_name"/>
|
||||
<div>
|
||||
<field name="contact_name" class="oe_inline"/>
|
||||
<field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": True}' class="oe_inline"/>
|
||||
</div>
|
||||
<field name="function" />
|
||||
<field name="function"/>
|
||||
<field name="mobile"/>
|
||||
<field name="fax"/>
|
||||
</group>
|
||||
@@ -500,7 +500,7 @@
|
||||
<field name="channel_id" widget="selection"/>
|
||||
</group>
|
||||
<group string="Mailings">
|
||||
<field name="opt_out" />
|
||||
<field name="opt_out"/>
|
||||
</group>
|
||||
<group string="Misc">
|
||||
<field name="active"/>
|
||||
@@ -542,15 +542,15 @@
|
||||
<field name="create_date" groups="base.group_no_one"/>
|
||||
<field name="name" string="Opportunity"/>
|
||||
<field name="partner_id" string="Customer"/>
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)" />
|
||||
<field name="country_id" invisible="context.get('invisible_country', True)"/>
|
||||
<field name="date_action"/>
|
||||
<field name="title_action" />
|
||||
<field name="title_action"/>
|
||||
<field name="channel_id" invisible="1"/>
|
||||
<field name="type_id" invisible="1"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="planned_revenue" sum="Expected Revenues"/>
|
||||
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
|
||||
<field name="section_id" invisible="context.get('invisible_section', True)" />
|
||||
<field name="section_id" invisible="context.get('invisible_section', True)"/>
|
||||
<field name="user_id"/>
|
||||
<field name="priority" invisible="1"/>
|
||||
<field name="state" groups="base.group_no_one"/>
|
||||
@@ -568,30 +568,30 @@
|
||||
<search string="Search Opportunities">
|
||||
<field name="name" string="Opportunity / Customer"
|
||||
filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
|
||||
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]" />
|
||||
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
|
||||
<filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||
<separator/>
|
||||
<filter icon="terp-check" string="New" help="New Opportunities" name="new" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-camera_test" string="In Progress" help="Open Opportunities" name="open" domain="[('state','=','open')]"/>
|
||||
<separator/>
|
||||
<filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities" />
|
||||
<filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities"/>
|
||||
<separator/>
|
||||
<filter string="Opportunities Assigned to Me or My Team(s)" icon="terp-personal+"
|
||||
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
|
||||
help="Opportunities that are assigned to either me or one of the sale teams I manage" />
|
||||
help="Opportunities that are assigned to either me or one of the sale teams I manage"/>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
|
||||
<field name="partner_id"/>
|
||||
<group expand="0" string="Group By..." colspan="16">
|
||||
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
|
||||
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
|
||||
<filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
|
||||
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
|
||||
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
|
||||
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
|
||||
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
|
||||
<filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
|
||||
<filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}"/>
|
||||
<filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
|
||||
<filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
|
||||
<filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
|
||||
</group>
|
||||
<group string="Display">
|
||||
<filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
|
||||
|
||||
+15
-16
@@ -24,9 +24,9 @@
|
||||
parent="base.menu_base_config" sequence="45" groups="base.group_sale_salesman"/>
|
||||
|
||||
<menuitem id="base.next_id_64" name="Sales"
|
||||
parent="base.menu_reporting" sequence="1" />
|
||||
parent="base.menu_reporting" sequence="1"/>
|
||||
|
||||
<menuitem id="base.menu_sales_configuration_misc" name="Miscellaneous" parent="base.menu_base_config" sequence="75"/>
|
||||
<menuitem id="base.menu_sales_configuration_misc" name="Miscellaneous" parent="base.menu_base_config" sequence="81"/>
|
||||
|
||||
|
||||
<!-- crm.case.channel -->
|
||||
@@ -86,7 +86,7 @@
|
||||
<field name="parent_id"/>
|
||||
<field name="code"/>
|
||||
</group>
|
||||
|
||||
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="resource_calendar_id"/>
|
||||
@@ -102,7 +102,6 @@
|
||||
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="change_responsible"/>
|
||||
<field name="allow_unlink"/>
|
||||
</group>
|
||||
<separator string="Team Members"/>
|
||||
<field name="member_ids" widget="many2many_kanban">
|
||||
@@ -163,7 +162,7 @@
|
||||
<field name="view_id" ref="crm_case_section_view_tree"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new sales team.
|
||||
Click to define a new sales team.
|
||||
</p><p>
|
||||
Use sales team to organize your different salespersons or
|
||||
departments into separate teams. Each team will work in
|
||||
@@ -203,7 +202,7 @@
|
||||
<form string="Stage" version="7.0">
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="state" />
|
||||
<field name="state"/>
|
||||
<field name="probability"/>
|
||||
<field name="type"/>
|
||||
<field name="on_change"/>
|
||||
@@ -228,7 +227,7 @@
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Case Categories Form View -->
|
||||
<!-- Case Categories Form View -->
|
||||
|
||||
<record id="crm_case_categ-view" model="ir.ui.view">
|
||||
<field name="name">crm.case.categ.form</field>
|
||||
@@ -238,7 +237,7 @@
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="section_id"/>
|
||||
<field name="object_id" invisible="1" />
|
||||
<field name="object_id" invisible="1"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -297,7 +296,7 @@
|
||||
<menuitem action="crm_case_resource_type_act"
|
||||
id="menu_crm_case_resource_type_act" sequence="4"
|
||||
groups="base.group_no_one"
|
||||
parent="base.menu_crm_config_lead" />
|
||||
parent="base.menu_crm_config_lead"/>
|
||||
|
||||
<record id="crm_case_section_act_tree" model="ir.actions.act_window">
|
||||
<field name="name">Cases by Sales Team</field>
|
||||
@@ -354,13 +353,13 @@
|
||||
<button name="process_start"
|
||||
states="not running"
|
||||
string="Compute Segmentation" type="object"
|
||||
icon="gtk-execute" />
|
||||
icon="gtk-execute"/>
|
||||
<button name="process_stop" states="running"
|
||||
string="Stop Process" type="object"
|
||||
icon="gtk-cancel" />
|
||||
icon="gtk-cancel"/>
|
||||
<button name="process_continue" states="running"
|
||||
string="Continue Process" type="object"
|
||||
icon="gtk-go-forward" />
|
||||
icon="gtk-go-forward"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<group col="4">
|
||||
@@ -412,7 +411,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new customer segmentation.
|
||||
Click to define a new customer segmentation.
|
||||
</p><p>
|
||||
Create specific categories which you can assign to your
|
||||
contacts to better manage your interactions with them. The
|
||||
@@ -425,7 +424,7 @@
|
||||
<menuitem action="crm_segmentation_tree-act"
|
||||
id="menu_crm_segmentation-act"
|
||||
groups="base.group_no_one" sequence="15"
|
||||
parent="base.menu_base_config" />
|
||||
parent="base.menu_base_config"/>
|
||||
|
||||
<!-- menu for the working time -->
|
||||
<menuitem action="resource.action_resource_calendar_form" id="menu_action_resource_calendar_form" parent="resource.menu_resource_config" sequence="1"/>
|
||||
@@ -466,11 +465,11 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem action="action_crm_payment_mode"
|
||||
id="menu_crm_payment_mode_act"
|
||||
groups="base.group_no_one"
|
||||
name="Payment Modes"
|
||||
parent="base.menu_crm_config_lead" />
|
||||
parent="base.menu_crm_config_lead"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+30
-16
@@ -7,14 +7,14 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
|
||||
"PO-Revision-Date: 2012-02-10 17:48+0000\n"
|
||||
"Last-Translator: Carlos Ch. <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:10+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\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-30 04:57+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead.report:0
|
||||
@@ -172,7 +172,7 @@ msgstr "Mes esperado de cierre"
|
||||
#. module: crm
|
||||
#: view:crm.lead2opportunity.partner.mass:0
|
||||
msgid "Assigned Opportunities to"
|
||||
msgstr ""
|
||||
msgstr "Oportunidades asignadas a"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0 field:crm.lead,partner_id:0 view:crm.lead.report:0
|
||||
@@ -598,7 +598,7 @@ msgstr "Fecha de fin"
|
||||
#. module: crm
|
||||
#: view:crm.opportunity2phonecall:0 view:crm.phonecall2phonecall:0
|
||||
msgid "Schedule/Log a Call"
|
||||
msgstr ""
|
||||
msgstr "Planificar/Registrar una llamada"
|
||||
|
||||
#. module: crm
|
||||
#: constraint:base.action.rule:0
|
||||
@@ -792,7 +792,7 @@ msgstr "Siguiente"
|
||||
#. module: crm
|
||||
#: field:crm.segmentation,som_interval:0
|
||||
msgid "Days per Period"
|
||||
msgstr ""
|
||||
msgstr "Días por periodo"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.meeting,byday:0
|
||||
@@ -959,7 +959,7 @@ msgstr "Días para abrir"
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
msgid "Show Time as"
|
||||
msgstr ""
|
||||
msgstr "Mostrar hora como"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.phonecall2partner:0
|
||||
@@ -1342,7 +1342,7 @@ msgstr "Fecha escritura"
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
msgid "End of Recurrency"
|
||||
msgstr ""
|
||||
msgstr "Fin de recurrencia"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
@@ -1392,6 +1392,12 @@ msgid ""
|
||||
" \n"
|
||||
"If the call needs to be done then the state is set to 'Not Held'."
|
||||
msgstr ""
|
||||
"El estado se establece a 'Para hacer' cuando se crea el caso.\n"
|
||||
"Si es caso está en marcha, el estado se establece a 'Abierto.\n"
|
||||
"Cuando la llamada se termina, el estado se establece en 'Realizada'. "
|
||||
" \n"
|
||||
"Si la llamada está pendiente de ser realizada, entonces el estado se "
|
||||
"establece en 'Pendiente'."
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.meeting,week_list:0
|
||||
@@ -1449,7 +1455,7 @@ msgstr "Oportunidades por categorías"
|
||||
#. module: crm
|
||||
#: model:crm.case.section,name:crm.section_sales_marketing_department
|
||||
msgid "Sales Marketing Department"
|
||||
msgstr ""
|
||||
msgstr "Departamento de ventas y marketing"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.phonecall.report:0
|
||||
@@ -1900,7 +1906,7 @@ msgstr "Responder a"
|
||||
#. module: crm
|
||||
#: view:crm.case.section:0
|
||||
msgid "Select Stages for this Sales Team"
|
||||
msgstr ""
|
||||
msgstr "Seleccione etapas para este equipo de ventas"
|
||||
|
||||
#. module: crm
|
||||
#: view:board.board:0
|
||||
@@ -2015,7 +2021,7 @@ msgstr "Ubicación"
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_lead2opportunity_partner_mass
|
||||
msgid "Mass Lead To Opportunity Partner"
|
||||
msgstr ""
|
||||
msgstr "Transformación masiva de iniciativa a oportunidad"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0
|
||||
@@ -2777,7 +2783,7 @@ msgstr "e-mail del contacto"
|
||||
#. module: crm
|
||||
#: field:crm.lead,referred:0
|
||||
msgid "Referred by"
|
||||
msgstr ""
|
||||
msgstr "Referido por"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.lead:0 model:ir.model,name:crm.model_crm_add_note
|
||||
@@ -3541,7 +3547,7 @@ msgstr "Nuevas oportunidades"
|
||||
#: code:addons/crm/crm_action_rule.py:61
|
||||
#, python-format
|
||||
msgid "No E-Mail Found for your Company address!"
|
||||
msgstr ""
|
||||
msgstr "No se encontró dirección de e-mail para el contacto de su compañía"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.lead.report,email:0
|
||||
@@ -3561,7 +3567,7 @@ msgstr "Oportunidades por usuario y equipo"
|
||||
#. module: crm
|
||||
#: view:crm.phonecall:0
|
||||
msgid "Reset to Todo"
|
||||
msgstr ""
|
||||
msgstr "Cambiar a 'Para hacer'"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.section,working_hours:0
|
||||
@@ -3643,6 +3649,10 @@ msgid ""
|
||||
"partner. From the phone call form, you can trigger a request for another "
|
||||
"call, a meeting or an opportunity."
|
||||
msgstr ""
|
||||
"Esta herramienta permite registrar sus llamadas entrantes sobre la marcha. "
|
||||
"Cada llamada que recibe aparecerá en el formulario de la empresa para trazar "
|
||||
"cada contacto que tiene con una empresa. Desde el formulario de llamadas, "
|
||||
"puede lanzar una petición para otra llamada, una reunión u oportunidad."
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.lead.report,creation_month:0
|
||||
@@ -3673,6 +3683,10 @@ msgid ""
|
||||
"channels that will be maintained at the creation of a document in the "
|
||||
"system. Some examples of channels can be: Website, Phone Call, Reseller, etc."
|
||||
msgstr ""
|
||||
"Controle el origen de sus iniciativas y oportunidades de venta mediante la "
|
||||
"creación de canales específicos que se usarán en la creación de documentos "
|
||||
"en el sistema. Algunos ejemplos de canales son: Sitio web, llamada "
|
||||
"telefónica, distribuidores, ..."
|
||||
|
||||
#. module: crm
|
||||
#: selection:crm.lead2opportunity.partner,name:0
|
||||
@@ -3740,7 +3754,7 @@ msgstr "Año"
|
||||
#. module: crm
|
||||
#: constraint:res.partner:0
|
||||
msgid "Error ! You cannot create recursive associated members."
|
||||
msgstr ""
|
||||
msgstr "¡Error! No puede crear miembros asociados recursivamente."
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.resource.type,name:crm.type_lead8
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<field name="res_model">crm.phonecall.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{"search_default_year":1,"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{"search_default_year":1,"search_default_Salesperson":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="view_id" ref="view_report_crm_phonecall_tree"/>
|
||||
<field name="search_view_id" ref="view_report_crm_phonecall_filter"/>
|
||||
<field name="help">From this report, you can analyse the performance of your sales team, based on their phone calls. You can group or filter the information according to several criteria and drill down the information, by adding more groups in the report.</field>
|
||||
|
||||
@@ -105,7 +105,7 @@ class crm_claim(base_stage, osv.osv):
|
||||
'email_from': fields.char('Email', size=128, help="Destination email for email gateway."),
|
||||
'partner_phone': fields.char('Phone', size=32),
|
||||
'stage_id': fields.many2one ('crm.claim.stage', 'Stage',
|
||||
domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
|
||||
domain="['&',('fold', '=', False),'|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
|
||||
'cause': fields.text('Root Cause'),
|
||||
'state': fields.related('stage_id', 'state', type="selection", store=True,
|
||||
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
|
||||
@@ -224,7 +224,7 @@ class crm_claim(base_stage, osv.osv):
|
||||
}
|
||||
for line in msg['body'].split('\n'):
|
||||
line = line.strip()
|
||||
res = tools.misc.command_re.match(line)
|
||||
res = tools.command_re.match(line)
|
||||
if res and maps.get(res.group(1).lower()):
|
||||
key = maps.get(res.group(1).lower())
|
||||
update_vals[key] = res.group(2).lower()
|
||||
|
||||
@@ -43,38 +43,32 @@
|
||||
-->
|
||||
|
||||
<record model="crm.claim.stage" id="stage_claim1">
|
||||
<field name="name">Draft claim</field>
|
||||
<field name="name">New</field>
|
||||
<field name="state">draft</field>
|
||||
<field name="sequence">26</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
</record>
|
||||
<record model="crm.claim.stage" id="stage_claim5">
|
||||
<field name="name">Actions Defined</field>
|
||||
<field name="name">In Progress</field>
|
||||
<field name="state">open</field>
|
||||
<field name="sequence">27</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
</record>
|
||||
<record model="crm.claim.stage" id="stage_claim2">
|
||||
<field name="name">Actions Done</field>
|
||||
<field name="name">Settled</field>
|
||||
<field name="state">done</field>
|
||||
<field name="sequence">28</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
</record>
|
||||
<record model="crm.claim.stage" id="stage_claim3">
|
||||
<field name="name">Refused</field>
|
||||
<field name="state">done</field>
|
||||
<field name="name">Rejected</field>
|
||||
<field name="state">cancel</field>
|
||||
<field name="sequence">29</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
<field name="case_refused" eval="True"/>
|
||||
<field name="fold" eval="True"/>
|
||||
</record>
|
||||
<record model="crm.claim.stage" id="stage_claim3">
|
||||
<field name="name">Cancelled</field>
|
||||
<field name="state">cancel</field>
|
||||
<field name="sequence">30</field>
|
||||
<field name="case_default" eval="True"/>
|
||||
<field name="fold" eval="True"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<!-- Claim Stages -->
|
||||
<menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/>
|
||||
<menuitem id="base.menu_project_config_project" name="Stages" parent="base.menu_definitions" sequence="1"/>
|
||||
<menuitem id="menu_claim_stage_view" name="Claim Stages" action="crm_claim_stage_act" parent="base.menu_project_config_project" sequence="20"/>
|
||||
<menuitem id="menu_claim_stage_view" name="Stages" action="crm_claim_stage_act" parent="menu_config_claim" sequence="20"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -102,16 +102,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Claim" version="7.0">
|
||||
<header>
|
||||
<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_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"
|
||||
<button name="case_close" string="Settle" type="object" class="oe_highlight"
|
||||
states="draft,open,pending" groups="base.group_user"/>
|
||||
<button name="case_cancel" string="Reject" type="object" groups="base.group_user"
|
||||
states="draft,open,pending"/>
|
||||
<field name="stage_id" widget="statusbar"
|
||||
on_change="onchange_stage_id(stage_id)"/>
|
||||
<field name="stage_id" widget="statusbar" clickable="True"/>
|
||||
</header>
|
||||
<sheet string="Claims">
|
||||
<group>
|
||||
@@ -173,7 +168,7 @@
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -133,7 +133,7 @@ class crm_helpdesk(base_state, base_stage, osv.osv):
|
||||
}
|
||||
for line in msg['body'].split('\n'):
|
||||
line = line.strip()
|
||||
res = tools.misc.command_re.match(line)
|
||||
res = tools.command_re.match(line)
|
||||
if res and maps.get(res.group(1).lower()):
|
||||
key = maps.get(res.group(1).lower())
|
||||
update_vals[key] = res.group(2).lower()
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -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-01-16 17:13+0000\n"
|
||||
"Last-Translator: mgaja (GrupoIsep.com) <Unknown>\n"
|
||||
"PO-Revision-Date: 2012-11-09 12:10+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@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-30 05:33+0000\n"
|
||||
"X-Generator: Launchpad (build 16206)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-10 04:59+0000\n"
|
||||
"X-Generator: Launchpad (build 16251)\n"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,send_to:0
|
||||
@@ -25,12 +25,12 @@ msgstr "Enviar a"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,subtype:0
|
||||
msgid "Message type"
|
||||
msgstr ""
|
||||
msgstr "Tipo de mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,auto_delete:0
|
||||
msgid "Permanently delete emails after sending"
|
||||
msgstr ""
|
||||
msgstr "Eliminar permanentemente los emails depués de su envío"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.report.assign,delay_close:0
|
||||
@@ -40,7 +40,7 @@ msgstr "Retraso para cerrar"
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,email_to:0
|
||||
msgid "Message recipients"
|
||||
msgstr ""
|
||||
msgstr "Destinatarios del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.report.assign,planned_revenue:0
|
||||
@@ -61,7 +61,7 @@ msgstr "Agrupar por..."
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,template_id:0
|
||||
msgid "Template"
|
||||
msgstr ""
|
||||
msgstr "Plantilla"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead:0
|
||||
@@ -76,12 +76,12 @@ msgstr "Geo localizar"
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,body:0
|
||||
msgid "Plain-text version of the message"
|
||||
msgstr ""
|
||||
msgstr "Versión en texto plano del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.forward.to.partner:0
|
||||
msgid "Body"
|
||||
msgstr ""
|
||||
msgstr "Cuerpo"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,month:0
|
||||
@@ -101,7 +101,7 @@ msgstr "Demora cierre"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.partner.report.assign:0
|
||||
msgid "#Partner"
|
||||
msgstr ""
|
||||
msgstr "Nº empresa"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.forward.to.partner,history:0
|
||||
@@ -137,7 +137,7 @@ msgstr "Más alta"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,body:0
|
||||
msgid "Text contents"
|
||||
msgstr ""
|
||||
msgstr "Contenido del texto"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -148,7 +148,7 @@ msgstr "Día"
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,message_id:0
|
||||
msgid "Message unique identifier"
|
||||
msgstr ""
|
||||
msgstr "Identificador único del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.forward.to.partner,history:0
|
||||
@@ -167,6 +167,8 @@ msgid ""
|
||||
"Add here all attachments of the current document you want to include in the "
|
||||
"Email."
|
||||
msgstr ""
|
||||
"Añada aquí todos los datos adjuntos del documento que quiere incluir en el "
|
||||
"correo."
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,state:0
|
||||
@@ -195,17 +197,17 @@ msgstr ""
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,body_html:0
|
||||
msgid "Rich-text/HTML version of the message"
|
||||
msgstr ""
|
||||
msgstr "Versión en texto enriquecido / HTML del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,auto_delete:0
|
||||
msgid "Auto Delete"
|
||||
msgstr ""
|
||||
msgstr "Auto eliminar"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,email_bcc:0
|
||||
msgid "Blind carbon copy message recipients"
|
||||
msgstr ""
|
||||
msgstr "Destinatarios de la copia oculta"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,partner_id:0
|
||||
@@ -254,7 +256,7 @@ msgstr "Sección"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.forward.to.partner:0
|
||||
msgid "Send"
|
||||
msgstr ""
|
||||
msgstr "Enviar"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:res.partner:0
|
||||
@@ -286,7 +288,7 @@ msgstr "Tipo"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.partner.report.assign:0
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
msgstr "Nombre"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,priority:0
|
||||
@@ -299,11 +301,13 @@ msgid ""
|
||||
"Type of message, usually 'html' or 'plain', used to select plaintext or rich "
|
||||
"text contents accordingly"
|
||||
msgstr ""
|
||||
"Tipo de mensaje, normalmente 'html' o 'plano', utilizado para seleccionar "
|
||||
"contenidos en texto plano o en texto enriquecido"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
msgid "Assign Date"
|
||||
msgstr ""
|
||||
msgstr "Fecha de asignación"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -318,7 +322,7 @@ msgstr "Fecha creación"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,res_id:0
|
||||
msgid "Related Document ID"
|
||||
msgstr ""
|
||||
msgstr "ID del docuemtno relacionado"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -349,7 +353,7 @@ msgstr "Etapa"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,model:0
|
||||
msgid "Related Document model"
|
||||
msgstr ""
|
||||
msgstr "Modelo del documento relacionado"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: code:addons/crm_partner_assign/wizard/crm_forward_to_partner.py:192
|
||||
@@ -392,7 +396,7 @@ msgstr "Cerrar"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,use_template:0
|
||||
msgid "Use Template"
|
||||
msgstr ""
|
||||
msgstr "Usar plantilla"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.actions.act_window,name:crm_partner_assign.action_report_crm_opportunity_assign
|
||||
@@ -464,12 +468,12 @@ msgstr "nº oportunidades"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead:0
|
||||
msgid "Team"
|
||||
msgstr ""
|
||||
msgstr "Equipo"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead:0
|
||||
msgid "Referred Partner"
|
||||
msgstr ""
|
||||
msgstr "Empresa referida"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,state:0
|
||||
@@ -490,7 +494,7 @@ msgstr "Cerrado"
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.actions.act_window,name:crm_partner_assign.action_crm_send_mass_forward
|
||||
msgid "Mass forward to partner"
|
||||
msgstr ""
|
||||
msgstr "Envío masivo a empresa"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:res.partner:0
|
||||
@@ -570,7 +574,7 @@ msgstr "Longitud Geo"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.partner.report.assign,opp:0
|
||||
msgid "# of Opportunity"
|
||||
msgstr ""
|
||||
msgstr "Nº oportunidad"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -600,12 +604,12 @@ msgstr "Empresa a la que este caso ha sido reenviado/asignado."
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
msgstr "Fecha"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,body_html:0
|
||||
msgid "Rich-text contents"
|
||||
msgstr ""
|
||||
msgstr "Contenido en texto enriquecido"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -620,18 +624,18 @@ msgstr "res.empresa.nivel"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,message_id:0
|
||||
msgid "Message-Id"
|
||||
msgstr ""
|
||||
msgstr "Id del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.forward.to.partner:0
|
||||
#: field:crm.lead.forward.to.partner,attachment_ids:0
|
||||
msgid "Attachments"
|
||||
msgstr ""
|
||||
msgstr "Adjuntos"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,email_cc:0
|
||||
msgid "Cc"
|
||||
msgstr ""
|
||||
msgstr "Cc"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,month:0
|
||||
@@ -641,7 +645,7 @@ msgstr "Septiembre"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,references:0
|
||||
msgid "References"
|
||||
msgstr ""
|
||||
msgstr "Referencias"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -668,7 +672,7 @@ msgstr "Abierto"
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,email_cc:0
|
||||
msgid "Carbon copy message recipients"
|
||||
msgstr ""
|
||||
msgstr "Destinatarios de la copia"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,headers:0
|
||||
@@ -676,6 +680,8 @@ msgid ""
|
||||
"Full message headers, e.g. SMTP session headers (usually available on "
|
||||
"inbound messages only)"
|
||||
msgstr ""
|
||||
"Cabeceras completas del mensaje, por ejemplo las cabeceras de sesión SMTP "
|
||||
"(normalmente disponibles sólo en mensajes entrantes)"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:res.partner,date_localization:0
|
||||
@@ -698,11 +704,13 @@ msgid ""
|
||||
"Message sender, taken from user preferences. If empty, this is not a mail "
|
||||
"but a message."
|
||||
msgstr ""
|
||||
"Remitente del mensaje, proveniente de las preferencias del usuario. Si está "
|
||||
"vacío, esto no es correo electrónico, sino un mensaje."
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.partner.report.assign,nbr:0
|
||||
msgid "# of Partner"
|
||||
msgstr ""
|
||||
msgstr "Nº empresa"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.forward.to.partner:0
|
||||
@@ -713,7 +721,7 @@ msgstr "Reenviar a empresa"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.partner.report.assign,name:0
|
||||
msgid "Partner name"
|
||||
msgstr ""
|
||||
msgstr "Nombre de la empresa"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,month:0
|
||||
@@ -728,7 +736,7 @@ msgstr "Ingreso estimado"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,reply_to:0
|
||||
msgid "Reply-To"
|
||||
msgstr ""
|
||||
msgstr "Responder a"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead,partner_assigned_id:0
|
||||
@@ -748,7 +756,7 @@ msgstr "Oportunidad"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.forward.to.partner:0
|
||||
msgid "Send Mail"
|
||||
msgstr ""
|
||||
msgstr "Enviar correo"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.report.assign,partner_id:0
|
||||
@@ -776,7 +784,7 @@ msgstr "País"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,headers:0
|
||||
msgid "Message headers"
|
||||
msgstr ""
|
||||
msgstr "Cabeceras del mensaje"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:res.partner:0
|
||||
@@ -786,7 +794,7 @@ msgstr "Convertir en oportunidad"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,email_bcc:0
|
||||
msgid "Bcc"
|
||||
msgstr ""
|
||||
msgstr "Cco"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead:0
|
||||
@@ -802,7 +810,7 @@ msgstr "Abril"
|
||||
#: model:ir.actions.act_window,name:crm_partner_assign.action_report_crm_partner_assign
|
||||
#: model:ir.ui.menu,name:crm_partner_assign.menu_report_crm_partner_assign_tree
|
||||
msgid "Partnership Analysis"
|
||||
msgstr ""
|
||||
msgstr "Análisis de la relación"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.model,name:crm_partner_assign.model_crm_lead
|
||||
@@ -817,7 +825,7 @@ msgstr "Pendiente"
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.partner.report.assign:0
|
||||
msgid "Partner assigned Analysis"
|
||||
msgstr ""
|
||||
msgstr "Análisis de la empresa asignada"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.model,name:crm_partner_assign.model_crm_lead_report_assign
|
||||
@@ -828,11 +836,12 @@ msgstr "Informe de iniciativas CRM"
|
||||
#: help:crm.lead.forward.to.partner,references:0
|
||||
msgid "Message references, such as identifiers of previous messages"
|
||||
msgstr ""
|
||||
"Referencias del mensaje, tales como identificadores de mensajes anteriores"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: constraint:res.partner:0
|
||||
msgid "Error ! You cannot create recursive associated members."
|
||||
msgstr ""
|
||||
msgstr "¡Error! No puede crear miembros asociados recursivamente."
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.forward.to.partner,history:0
|
||||
@@ -847,12 +856,12 @@ msgstr "Secuencia"
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.model,name:crm_partner_assign.model_crm_partner_report_assign
|
||||
msgid "CRM Partner Report"
|
||||
msgstr ""
|
||||
msgstr "Informe de la empresa CRM"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: model:ir.model,name:crm_partner_assign.model_crm_lead_forward_to_partner
|
||||
msgid "Email composition wizard"
|
||||
msgstr ""
|
||||
msgstr "Asistente de composición de e-mail"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: selection:crm.lead.report.assign,priority:0
|
||||
@@ -873,7 +882,7 @@ msgstr "Fecha de creación"
|
||||
#. module: crm_partner_assign
|
||||
#: field:crm.lead.forward.to.partner,filter_id:0
|
||||
msgid "Filters"
|
||||
msgstr ""
|
||||
msgstr "Filtros"
|
||||
|
||||
#. module: crm_partner_assign
|
||||
#: view:crm.lead.report.assign:0
|
||||
@@ -884,7 +893,7 @@ msgstr "Año"
|
||||
#. module: crm_partner_assign
|
||||
#: help:crm.lead.forward.to.partner,reply_to:0
|
||||
msgid "Preferred response address for the message"
|
||||
msgstr ""
|
||||
msgstr "Dirección de correo de respuesta preferida para este mensaje"
|
||||
|
||||
#~ msgid "Reply-to of the Sales team defined on this case"
|
||||
#~ msgstr "\"Responder a\" del equipo de ventas definido en este caso"
|
||||
@@ -941,3 +950,6 @@ msgstr ""
|
||||
#~ "partners o asesores,\n"
|
||||
#~ "basándose en geo-localización.\n"
|
||||
#~ " "
|
||||
|
||||
#~ msgid "E-mail composition wizard"
|
||||
#~ msgstr "Asistente de composición de e-mail"
|
||||
|
||||
@@ -823,6 +823,7 @@ class node_res_dir(node_class):
|
||||
uid = self.context.uid
|
||||
ctx = self.context.context.copy()
|
||||
ctx.update(self.dctx)
|
||||
ctx.update(self.context.extra_ctx)
|
||||
where = []
|
||||
if self.domain:
|
||||
app = safe_eval(self.domain, ctx)
|
||||
|
||||
@@ -272,7 +272,7 @@ class abstracted_fs(object):
|
||||
if path.startswith('/'):
|
||||
path = path[1:]
|
||||
|
||||
p_parts = path.split('/') # hard-code the unix sep here, by spec.
|
||||
p_parts = path.split(os.sep)
|
||||
|
||||
assert '..' not in p_parts
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class showdiff(osv.osv_memory):
|
||||
|
||||
elif len(ids) == 1:
|
||||
old = history.browse(cr, uid, ids[0])
|
||||
nids = history.search(cr, uid, [('document_id', '=', old.document_id.id)])
|
||||
nids = history.search(cr, uid, [('page_id', '=', old.page_id.id)])
|
||||
nids.sort()
|
||||
diff = history.getDiff(cr, uid, ids[0], nids[-1])
|
||||
else:
|
||||
|
||||
@@ -51,9 +51,10 @@ class document_davdir(osv.osv):
|
||||
# that might be not worth preparing.
|
||||
nctx.extra_ctx['webdav_path'] = '/'+config.get_misc('webdav','vdir','webdav')
|
||||
usr_obj = self.pool.get('res.users')
|
||||
res = usr_obj.read(cr, uid, uid, ['login'])
|
||||
res = usr_obj.read(cr, uid, uid, ['login','lang'])
|
||||
if res:
|
||||
nctx.extra_ctx['username'] = res['login']
|
||||
nctx.extra_ctx['lang'] = res['lang']
|
||||
# TODO group
|
||||
return
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@ from osv import osv
|
||||
from osv import fields
|
||||
import tools
|
||||
from tools.translate import _
|
||||
from tools.html_sanitize import html_sanitize
|
||||
from tools import append_content_to_html
|
||||
from urllib import quote as quote
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -119,7 +117,8 @@ class email_template(osv.osv):
|
||||
"of the message"),
|
||||
'subject': fields.char('Subject', translate=True, help="Subject (placeholders may be used here)",),
|
||||
'email_from': fields.char('From', help="Sender address (placeholders may be used here)"),
|
||||
'email_to': fields.char('To', help="Comma-separated recipient addresses (placeholders may be used here)"),
|
||||
'email_to': fields.char('To (Emails)', help="Comma-separated recipient addresses (placeholders may be used here)"),
|
||||
'email_recipients': fields.char('To (Partners)', help="Comma-separated ids of recipient partners (placeholders may be used here)"),
|
||||
'email_cc': fields.char('Cc', help="Carbon copy recipients (placeholders may be used here)"),
|
||||
'reply_to': fields.char('Reply-To', help="Preferred response address (placeholders may be used here)"),
|
||||
'mail_server_id': fields.many2one('ir.mail_server', 'Outgoing Mail Server', readonly=False,
|
||||
@@ -287,16 +286,16 @@ class email_template(osv.osv):
|
||||
template = self.get_email_template(cr, uid, template_id, res_id, context)
|
||||
values = {}
|
||||
for field in ['subject', 'body_html', 'email_from',
|
||||
'email_to', 'email_cc', 'reply_to']:
|
||||
'email_to', 'email_recipients', 'email_cc', 'reply_to']:
|
||||
values[field] = self.render_template(cr, uid, getattr(template, field),
|
||||
template.model, res_id, context=context) \
|
||||
or False
|
||||
if template.user_signature:
|
||||
signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
|
||||
values['body_html'] = append_content_to_html(values['body_html'], signature)
|
||||
values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
|
||||
|
||||
if values['body_html']:
|
||||
values['body'] = html_sanitize(values['body_html'])
|
||||
values['body'] = tools.html_sanitize(values['body_html'])
|
||||
|
||||
values.update(mail_server_id=template.mail_server_id.id or False,
|
||||
auto_delete=template.auto_delete,
|
||||
@@ -347,6 +346,7 @@ class email_template(osv.osv):
|
||||
values = self.generate_email(cr, uid, template_id, res_id, context=context)
|
||||
assert 'email_from' in values, 'email_from is missing or empty after template rendering, send_mail() cannot proceed'
|
||||
attachments = values.pop('attachments') or {}
|
||||
del values['email_recipients'] # TODO Properly use them.
|
||||
msg_id = mail_mail.create(cr, uid, values, context=context)
|
||||
# link attachments
|
||||
attachment_ids = []
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
<group>
|
||||
<group string="Addressing">
|
||||
<field name="email_from" required="1"/>
|
||||
<field name="email_to" required="1"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_recipients"/>
|
||||
<field name="email_cc"/>
|
||||
<field name="reply_to"/>
|
||||
<field name="user_signature"/>
|
||||
@@ -77,6 +78,7 @@
|
||||
<field name="subject"/>
|
||||
<field name="email_from"/>
|
||||
<field name="email_to"/>
|
||||
<field name="email_recipients"/>
|
||||
<field name="report_name"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
##############################################################################
|
||||
|
||||
import base64
|
||||
from openerp.addons.mail.tests import test_mail
|
||||
from openerp.addons.mail.tests import test_mail_mockup
|
||||
|
||||
|
||||
class test_message_compose(test_mail.TestMailMockups):
|
||||
class test_message_compose(test_mail_mockup.TestMailMockups):
|
||||
|
||||
def setUp(self):
|
||||
super(test_message_compose, self).setUp()
|
||||
@@ -52,8 +52,8 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
# Mail data
|
||||
_subject1 = 'Pigs'
|
||||
_subject2 = 'Bird'
|
||||
_body_html1 = 'Fans of Pigs, unite !\n<pre>Admin</pre>\n'
|
||||
_body_html2 = 'I am angry !\n<pre>Admin</pre>\n'
|
||||
_body_html1 = 'Fans of Pigs, unite !\n<p>Admin</p>\n'
|
||||
_body_html2 = 'I am angry !\n<p>Admin</p>\n'
|
||||
_attachments = [
|
||||
{'name': 'First', 'datas_fname': 'first.txt', 'datas': base64.b64encode('My first attachment')},
|
||||
{'name': 'Second', 'datas_fname': 'second.txt', 'datas': base64.b64encode('My second attachment')}
|
||||
@@ -63,11 +63,16 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
# Create template on mail.group, with attachments
|
||||
group_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'mail.group')])[0]
|
||||
email_template = self.registry('email.template')
|
||||
email_template_id = email_template.create(cr, uid, {'model_id': group_model_id,
|
||||
'name': 'Pigs Template', 'subject': '${object.name}',
|
||||
'body_html': '${object.description}', 'user_signature': True,
|
||||
email_template_id = email_template.create(cr, uid, {
|
||||
'model_id': group_model_id,
|
||||
'name': 'Pigs Template',
|
||||
'subject': '${object.name}',
|
||||
'body_html': '${object.description}',
|
||||
'user_signature': True,
|
||||
'attachment_ids': [(0, 0, _attachments[0]), (0, 0, _attachments[1])],
|
||||
'email_to': 'b@b.b c@c.c', 'email_cc': 'd@d.d'})
|
||||
'email_to': 'b@b.b c@c.c',
|
||||
'email_cc': 'd@d.d'
|
||||
})
|
||||
|
||||
# ----------------------------------------
|
||||
# CASE1: comment and save as template
|
||||
@@ -76,9 +81,9 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
# 1. Comment on pigs
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': 'Forget me subject', 'body': '<p>Dummy body</p>'},
|
||||
{'default_composition_mode': 'comment', 'default_model': 'mail.group',
|
||||
{'default_composition_mode': 'comment',
|
||||
'default_model': 'mail.group',
|
||||
'default_res_id': self.group_pigs_id,
|
||||
'default_template_id': email_template_id,
|
||||
'active_ids': [self.group_pigs_id, self.group_bird_id]})
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
|
||||
@@ -97,8 +102,10 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
# 1. Comment on pigs
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': 'Forget me subject', 'body': 'Dummy body'},
|
||||
{'default_composition_mode': 'comment', 'default_model': 'mail.group',
|
||||
{'default_composition_mode': 'comment',
|
||||
'default_model': 'mail.group',
|
||||
'default_res_id': self.group_pigs_id,
|
||||
'default_use_template': False,
|
||||
'default_template_id': email_template_id,
|
||||
'active_ids': [self.group_pigs_id, self.group_bird_id]})
|
||||
compose = mail_compose.browse(cr, uid, compose_id)
|
||||
@@ -135,8 +142,10 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
# 1. Mass_mail on pigs and bird, with a default_partner_ids set to check he is correctly added
|
||||
compose_id = mail_compose.create(cr, uid,
|
||||
{'subject': 'Forget me subject', 'body': 'Dummy body'},
|
||||
{'default_composition_mode': 'mass_mail', 'default_model': 'mail.group',
|
||||
{'default_composition_mode': 'mass_mail',
|
||||
'default_model': 'mail.group',
|
||||
'default_res_id': self.group_pigs_id,
|
||||
'default_use_template': False,
|
||||
'default_template_id': email_template_id,
|
||||
'default_partner_ids': [p_a_id],
|
||||
'active_ids': [self.group_pigs_id, self.group_bird_id]})
|
||||
@@ -170,3 +179,26 @@ class test_message_compose(test_mail.TestMailMockups):
|
||||
partner_ids = self.res_partner.search(cr, uid, [('email', 'in', ['b@b.b', 'c@c.c', 'd@d.d'])])
|
||||
self.assertEqual(set(message_pigs_pids), set(partner_ids), 'mail.message on pigs incorrect number of notified_partner_ids')
|
||||
self.assertEqual(set(message_bird_pids), set(partner_ids), 'mail.message on bird notified_partner_ids incorrect')
|
||||
|
||||
# ----------------------------------------
|
||||
# CASE4: test newly introduced email_recipients field
|
||||
# ----------------------------------------
|
||||
|
||||
# get already-created partners back
|
||||
p_b_id = self.res_partner.search(cr, uid, [('email', '=', 'b@b.b')])[0]
|
||||
p_c_id = self.res_partner.search(cr, uid, [('email', '=', 'c@c.c')])[0]
|
||||
p_d_id = self.res_partner.search(cr, uid, [('email', '=', 'd@d.d')])[0]
|
||||
# modify template: use email_recipients, use template and email address in email_to to test all features together
|
||||
user_model_id = self.registry('ir.model').search(cr, uid, [('model', '=', 'res.users')])[0]
|
||||
email_template.write(cr, uid, [email_template_id], {
|
||||
'model_id': user_model_id,
|
||||
'body_html': '${object.login}',
|
||||
'email_to': '${object.email} c@c',
|
||||
'email_recipients': '%i,%i' % (p_b_id, p_c_id),
|
||||
'email_cc': 'd@d',
|
||||
})
|
||||
# patner by email + partner by id (no double)
|
||||
send_to = [p_a_id, p_b_id, p_c_id, p_d_id]
|
||||
# Generate messsage with default email and partner on template
|
||||
mail_value = mail_compose.generate_email_for_composer(cr, uid, email_template_id, uid)
|
||||
self.assertEqual(set(mail_value['partner_ids']), set(send_to), 'mail.message partner_ids list created by template is incorrect')
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<group>
|
||||
<field name="email_from" readonly="1"/>
|
||||
<field name="email_to" readonly="1"/>
|
||||
<field name="email_recipients" readonly="1"/>
|
||||
<field name="email_cc" readonly="1" attrs="{'invisible':[('email_cc','=',False)]}"/>
|
||||
<field name="reply_to" readonly="1" attrs="{'invisible':[('reply_to','=',False)]}"/>
|
||||
<field name="subject" readonly="1"/>
|
||||
|
||||
@@ -25,6 +25,21 @@ from osv import osv
|
||||
from osv import fields
|
||||
|
||||
|
||||
def _reopen(self, res_id, model):
|
||||
return {'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'view_type': 'form',
|
||||
'res_id': res_id,
|
||||
'res_model': self._name,
|
||||
'target': 'new',
|
||||
# save original model in context, because selecting the list of available
|
||||
# templates requires a model in context
|
||||
'context': {
|
||||
'default_model': model,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
class mail_compose_message(osv.TransientModel):
|
||||
_inherit = 'mail.compose.message'
|
||||
|
||||
@@ -42,18 +57,17 @@ class mail_compose_message(osv.TransientModel):
|
||||
else:
|
||||
model = context.get('default_model', context.get('active_model'))
|
||||
|
||||
if model:
|
||||
record_ids = email_template_obj.search(cr, uid, [('model', '=', model)], context=context)
|
||||
return email_template_obj.name_get(cr, uid, record_ids, context) + [(False, '')]
|
||||
return []
|
||||
record_ids = email_template_obj.search(cr, uid, [('model', '=', model)], context=context)
|
||||
return email_template_obj.name_get(cr, uid, record_ids, context) + [(False, '')]
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
result = super(mail_compose_message, self).default_get(cr, uid, fields, context=context)
|
||||
result['template_id'] = context.get('default_template_id', context.get('mail.compose.template_id', False))
|
||||
|
||||
# pre-render the template if any
|
||||
if result.get('use_template'):
|
||||
if result.get('use_template') and result.get('template_id'):
|
||||
onchange_res = self.onchange_use_template(cr, uid, [], result.get('use_template'), result.get('template_id'),
|
||||
result.get('composition_mode'), result.get('model'), result.get('res_id'), context=context)
|
||||
result.update(onchange_res['value'])
|
||||
@@ -65,6 +79,10 @@ class mail_compose_message(osv.TransientModel):
|
||||
'template_id': fields.selection(_get_templates, 'Template', size=-1),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'use_template': True,
|
||||
}
|
||||
|
||||
def onchange_template_id(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None):
|
||||
""" - use_template not set: return default_get
|
||||
- use_template set in mass_mailing: we cannot render, so return the template values
|
||||
@@ -84,6 +102,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
'datas_fname': attach_fname,
|
||||
'res_model': model,
|
||||
'res_id': res_id,
|
||||
'type': 'binary', # overwrite the context default_value
|
||||
}
|
||||
values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context))
|
||||
else:
|
||||
@@ -104,7 +123,7 @@ class mail_compose_message(osv.TransientModel):
|
||||
onchange_res['partner_ids'] = [(4, partner_id) for partner_id in onchange_res.pop('partner_ids', [])]
|
||||
onchange_res['attachment_ids'] = [(4, attachment_id) for attachment_id in onchange_res.pop('attachment_ids', [])]
|
||||
record.write(onchange_res)
|
||||
return True
|
||||
return _reopen(self, record.id, record.model)
|
||||
|
||||
def onchange_use_template(self, cr, uid, ids, use_template, template_id, composition_mode, model, res_id, context=None):
|
||||
""" onchange_use_template (values: True or False). If use_template is
|
||||
@@ -136,8 +155,8 @@ class mail_compose_message(osv.TransientModel):
|
||||
'attachment_ids': [(6, 0, [att.id for att in record.attachment_ids])]
|
||||
}
|
||||
template_id = email_template.create(cr, uid, values, context=context)
|
||||
record.write({'template_id': template_id, 'use_template': True})
|
||||
return True
|
||||
record.write(record.onchange_template_id(True, template_id, record.composition_mode, record.model, record.res_id)['value'])
|
||||
return _reopen(self, record.id, record.model)
|
||||
|
||||
#------------------------------------------------------
|
||||
# Wizard validation and send
|
||||
@@ -148,15 +167,23 @@ class mail_compose_message(osv.TransientModel):
|
||||
mail.compose.message, transform email_cc and email_to into partner_ids """
|
||||
template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context)
|
||||
# filter template values
|
||||
fields = ['body', 'body_html', 'subject', 'email_to', 'email_cc', 'attachments']
|
||||
fields = ['body', 'body_html', 'subject', 'email_to', 'email_recipients', 'email_cc', 'attachments']
|
||||
values = dict((field, template_values[field]) for field in fields if template_values.get(field))
|
||||
values['body'] = values.pop('body_html', '')
|
||||
# transform email_to, email_cc into partner_ids
|
||||
values['partner_ids'] = []
|
||||
|
||||
mails = tools.email_split(values.pop('email_to', '') + ' ' + values.pop('email_cc', ''))
|
||||
for mail in mails:
|
||||
partner_id = self.pool.get('res.partner').find_or_create(cr, uid, mail, context=context)
|
||||
values['partner_ids'].append(partner_id)
|
||||
email_recipients = values.pop('email_recipients', '')
|
||||
if email_recipients:
|
||||
for partner_id in email_recipients.split(','):
|
||||
values['partner_ids'].append(int(partner_id))
|
||||
|
||||
values['partner_ids'] = list(set(values['partner_ids']))
|
||||
|
||||
return values
|
||||
|
||||
def render_message(self, cr, uid, wizard, res_id, context=None):
|
||||
|
||||
@@ -8,23 +8,22 @@
|
||||
<field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//form/group" position="after">
|
||||
<group attrs="{'invisible':[('use_template','=',False)]}">
|
||||
<field name="use_template" invisible="1"
|
||||
on_change="onchange_use_template(use_template, template_id, composition_mode, model, res_id, context)"/>
|
||||
<field name="template_id"
|
||||
on_change="onchange_template_id(use_template, template_id, composition_mode, model, res_id, context)"/>
|
||||
</group>
|
||||
<xpath expr="//field[@name='content_subtype']" position="after">
|
||||
<field name="use_template" invisible="1"
|
||||
on_change="onchange_use_template(use_template, template_id, composition_mode, model, res_id, context)"/>
|
||||
</xpath>
|
||||
<xpath expr="//form/footer/button" position="after">
|
||||
<button icon="/email_template/static/src/img/email_template.png"
|
||||
type="object" name="toggle_template" string=""
|
||||
help="Use a message template"
|
||||
attrs="{'invisible':[('content_subtype','!=','html')]}"/>
|
||||
<button icon="/email_template/static/src/img/email_template_save.png"
|
||||
type="object" name="save_as_template" string=""
|
||||
help="Save as a new template"
|
||||
attrs="{'invisible':[('content_subtype','!=','html')]}"/>
|
||||
<xpath expr="//footer" position="inside">
|
||||
<group class="oe_right" col="1">
|
||||
<div attrs="{'invisible':[('use_template','=',False)]}">Use template
|
||||
<field name="template_id" attrs="{'invisible':[('use_template','=',False)]}"
|
||||
nolabel="1"
|
||||
on_change="onchange_template_id(use_template, template_id, composition_mode, model, res_id, context)"/>
|
||||
</div>
|
||||
<button icon="/email_template/static/src/img/email_template_save.png"
|
||||
type="object" name="save_as_template" string="Save as new template" class="oe_link"
|
||||
help="Save as a new template"
|
||||
attrs="{'invisible':[('content_subtype','!=','html')]}"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
@@ -473,7 +473,7 @@
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
|
||||
<field name="message_ids" widget="mail_thread" placeholder="Share a note..."/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -14,11 +14,13 @@
|
||||
border-bottom-left-radius:3px;
|
||||
border-bottom-right-radius:3px;
|
||||
font-size: 12px;
|
||||
border-collapse: separate;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
color: #8A89BA;
|
||||
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.oe_event_month_year{
|
||||
border-bottom-left-radius:3px;
|
||||
|
||||
@@ -39,7 +39,7 @@ class sale_order_line(osv.osv):
|
||||
_columns = {
|
||||
'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_type_id': fields.related('product_id','event_type_id', type='many2one', relation="event.type", string="Event Type"),
|
||||
'event_ok': fields.related('product_id', 'event_ok', string='event_ok', type='boolean'),
|
||||
}
|
||||
|
||||
|
||||
@@ -243,20 +243,20 @@ class mail_mail(osv.osv):
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
if context is None:
|
||||
context={}
|
||||
context = {}
|
||||
fetchmail_server_id = context.get('fetchmail_server_id')
|
||||
if fetchmail_server_id:
|
||||
values['fetchmail_server_id'] = fetchmail_server_id
|
||||
res = super(mail_mail,self).create(cr, uid, values, context=context)
|
||||
res = super(mail_mail, self).create(cr, uid, values, context=context)
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
if context is None:
|
||||
context={}
|
||||
context = {}
|
||||
fetchmail_server_id = context.get('fetchmail_server_id')
|
||||
if fetchmail_server_id:
|
||||
values['fetchmail_server_id'] = server_id
|
||||
res = super(mail_mail,self).write(cr, uid, ids, values, context=context)
|
||||
values['fetchmail_server_id'] = fetchmail_server_id
|
||||
res = super(mail_mail, self).write(cr, uid, ids, values, context=context)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import fleet
|
||||
@@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name' : 'Fleet Management',
|
||||
'version' : '0.1',
|
||||
'author' : 'OpenERP S.A.',
|
||||
'category': 'Managing vehicles and contracts',
|
||||
'website' : 'http://www.openerp.com',
|
||||
'summary' : 'Vehicle, leasing, insurances, costs',
|
||||
'description' : """
|
||||
Vehicle, leasing, insurances, cost
|
||||
==================================
|
||||
With this module, OpenERP helps you managing all your vehicles, the
|
||||
contracts associated to those vehicle as well as services, fuel log
|
||||
entries, costs and many other features necessary to the management
|
||||
of your fleet of vehicle(s)
|
||||
|
||||
Main Features
|
||||
-------------
|
||||
* Add vehicles to your fleet
|
||||
* Manage contracts for vehicles
|
||||
* Reminder when a contract reach its expiration date
|
||||
* Add services, fuel log entry, odometer values for all vehicles
|
||||
* Show all costs associated to a vehicle or to a type of service
|
||||
* Analysis graph for costs
|
||||
""",
|
||||
'depends' : [
|
||||
'base',
|
||||
'mail',
|
||||
'board'
|
||||
],
|
||||
'data' : [
|
||||
'fleet_view.xml',
|
||||
'fleet_data.xml',
|
||||
'fleet_board_view.xml',
|
||||
],
|
||||
'update_xml' : ['security/ir.model.access.csv'],
|
||||
|
||||
'demo': ['fleet_cars.xml','fleet_demo.xml'],
|
||||
|
||||
'installable' : True,
|
||||
'application' : True,
|
||||
}
|
||||
@@ -0,0 +1,820 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
import time
|
||||
import datetime
|
||||
import tools
|
||||
from osv.orm import except_orm
|
||||
from tools.translate import _
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
def str_to_datetime(strdate):
|
||||
return datetime.datetime.strptime(strdate, tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
|
||||
class fleet_vehicle_cost(osv.Model):
|
||||
_name = 'fleet.vehicle.cost'
|
||||
_description = 'Cost related to a vehicle'
|
||||
_order = 'date desc, vehicle_id asc'
|
||||
|
||||
def _get_odometer(self, cr, uid, ids, odometer_id, arg, context):
|
||||
res = dict.fromkeys(ids, False)
|
||||
for record in self.browse(cr,uid,ids,context=context):
|
||||
if record.odometer_id:
|
||||
res[record.id] = record.odometer_id.value
|
||||
return res
|
||||
|
||||
def _set_odometer(self, cr, uid, id, name, value, args=None, context=None):
|
||||
if not value:
|
||||
raise except_orm(_('Operation not allowed!'), _('Emptying the odometer value of a vehicle is not allowed.'))
|
||||
date = self.browse(cr, uid, id, context=context).date
|
||||
if not(date):
|
||||
date = fields.date.context_today(self, cr, uid, context=context)
|
||||
vehicle_id = self.browse(cr, uid, id, context=context).vehicle_id
|
||||
data = {'value': value, 'date': date, 'vehicle_id': vehicle_id.id}
|
||||
odometer_id = self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context)
|
||||
return self.write(cr, uid, id, {'odometer_id': odometer_id}, context=context)
|
||||
|
||||
def _year_get_fnc(self, cr, uid, ids, name, unknow_none, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
if (record.date):
|
||||
res[record.id] = str(time.strptime(record.date, tools.DEFAULT_SERVER_DATE_FORMAT).tm_year)
|
||||
else:
|
||||
res[record.id] = _('Unknown')
|
||||
return res
|
||||
|
||||
def _cost_name_get_fnc(self, cr, uid, ids, name, unknow_none, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
name = record.vehicle_id.name
|
||||
if record.cost_subtype.name:
|
||||
name += ' / '+ record.cost_subtype.name
|
||||
if record.date:
|
||||
name += ' / '+ record.date
|
||||
res[record.id] = name
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.function(_cost_name_get_fnc, type="char", string='Name', store=True),
|
||||
'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this log'),
|
||||
'cost_subtype': fields.many2one('fleet.service.type', 'Type', help='Cost type purchased with this cost'),
|
||||
'amount': fields.float('Total Price'),
|
||||
'cost_type': fields.selection([('contract', 'Contract'), ('services','Services'), ('fuel','Fuel'), ('other','Other')], 'Category of the cost', help='For internal purpose only', required=True),
|
||||
'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', help='Parent cost to this current cost'),
|
||||
'cost_ids': fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'),
|
||||
'odometer_id': fields.many2one('fleet.vehicle.odometer', 'Odometer', help='Odometer measure of the vehicle at the moment of this log'),
|
||||
'odometer': fields.function(_get_odometer, fnct_inv=_set_odometer, type='float', string='Odometer Value', help='Odometer measure of the vehicle at the moment of this log'),
|
||||
'odometer_unit': fields.related('vehicle_id', 'odometer_unit', type="char", string="Unit", readonly=True),
|
||||
'date' :fields.date('Date',help='Date when the cost has been executed'),
|
||||
'contract_id': fields.many2one('fleet.vehicle.log.contract', 'Contract', help='Contract attached to this cost'),
|
||||
'auto_generated': fields.boolean('Automatically Generated', readonly=True, required=True),
|
||||
'year': fields.function(_year_get_fnc, type="char", string='Year', store=True),
|
||||
}
|
||||
|
||||
_defaults ={
|
||||
'cost_type': 'other',
|
||||
}
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
#make sure that the data are consistent with values of parent and contract records given
|
||||
if 'parent_id' in data and data['parent_id']:
|
||||
parent = self.browse(cr, uid, data['parent_id'], context=context)
|
||||
data['vehicle_id'] = parent.vehicle_id.id
|
||||
data['date'] = parent.date
|
||||
data['cost_type'] = parent.cost_type
|
||||
if 'contract_id' in data and data['contract_id']:
|
||||
contract = self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, data['contract_id'], context=context)
|
||||
data['vehicle_id'] = contract.vehicle_id.id
|
||||
data['cost_subtype'] = contract.cost_subtype.id
|
||||
data['cost_type'] = contract.cost_type
|
||||
if 'odometer' in data and not data['odometer']:
|
||||
#if received value for odometer is 0, then remove it from the data as it would result to the creation of a
|
||||
#odometer log with 0, which is to be avoided
|
||||
del(data['odometer'])
|
||||
return super(fleet_vehicle_cost, self).create(cr, uid, data, context=context)
|
||||
|
||||
|
||||
class fleet_vehicle_tag(osv.Model):
|
||||
_name = 'fleet.vehicle.tag'
|
||||
_columns = {
|
||||
'name': fields.char('Name', required=True, translate=True),
|
||||
}
|
||||
|
||||
class fleet_vehicle_state(osv.Model):
|
||||
_name = 'fleet.vehicle.state'
|
||||
_order = 'sequence asc'
|
||||
_columns = {
|
||||
'name': fields.char('Name', required=True),
|
||||
'sequence': fields.integer('Order', help="Used to order the note stages")
|
||||
}
|
||||
_sql_constraints = [('fleet_state_name_unique','unique(name)', 'State name already exists')]
|
||||
|
||||
|
||||
class fleet_vehicle_model(osv.Model):
|
||||
|
||||
def _model_name_get_fnc(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
name = record.modelname
|
||||
if record.brand.name:
|
||||
name = record.brand.name + ' / ' + name
|
||||
res[record.id] = name
|
||||
return res
|
||||
|
||||
def on_change_brand(self, cr, uid, ids, model_id, context=None):
|
||||
if not model_id:
|
||||
return {'value': {'image_medium': False}}
|
||||
brand = self.pool.get('fleet.vehicle.model.brand').browse(cr, uid, model_id, context=context)
|
||||
return {
|
||||
'value': {
|
||||
'image_medium': brand.image,
|
||||
}
|
||||
}
|
||||
|
||||
_name = 'fleet.vehicle.model'
|
||||
_description = 'Model of a vehicle'
|
||||
_order = 'name asc'
|
||||
|
||||
_columns = {
|
||||
'name': fields.function(_model_name_get_fnc, type="char", string='Name', store=True),
|
||||
'modelname': fields.char('Model name', size=32, required=True),
|
||||
'brand': fields.many2one('fleet.vehicle.model.brand', 'Model Brand', required=True, help='Brand of the vehicle'),
|
||||
'vendors': fields.many2many('res.partner', 'fleet_vehicle_model_vendors', 'model_id', 'partner_id', string='Vendors'),
|
||||
'image': fields.related('brand', 'image', type="binary", string="Logo"),
|
||||
'image_medium': fields.related('brand', 'image_medium', type="binary", string="Logo"),
|
||||
'image_small': fields.related('brand', 'image_small', type="binary", string="Logo"),
|
||||
}
|
||||
|
||||
|
||||
class fleet_vehicle_model_brand(osv.Model):
|
||||
_name = 'fleet.vehicle.model.brand'
|
||||
_description = 'Brand model of the vehicle'
|
||||
|
||||
_order = 'name asc'
|
||||
|
||||
def _get_image(self, cr, uid, ids, name, args, context=None):
|
||||
result = dict.fromkeys(ids, False)
|
||||
for obj in self.browse(cr, uid, ids, context=context):
|
||||
result[obj.id] = tools.image_get_resized_images(obj.image)
|
||||
return result
|
||||
|
||||
def _set_image(self, cr, uid, id, name, value, args, context=None):
|
||||
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Brand Name', size=64, required=True),
|
||||
'image': fields.binary("Logo",
|
||||
help="This field holds the image used as logo for the brand, limited to 1024x1024px."),
|
||||
'image_medium': fields.function(_get_image, fnct_inv=_set_image,
|
||||
string="Medium-sized photo", type="binary", multi="_get_image",
|
||||
store = {
|
||||
'fleet.vehicle.model.brand': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
},
|
||||
help="Medium-sized logo of the brand. It is automatically "\
|
||||
"resized as a 128x128px image, with aspect ratio preserved. "\
|
||||
"Use this field in form views or some kanban views."),
|
||||
'image_small': fields.function(_get_image, fnct_inv=_set_image,
|
||||
string="Smal-sized photo", type="binary", multi="_get_image",
|
||||
store = {
|
||||
'fleet.vehicle.model.brand': (lambda self, cr, uid, ids, c={}: ids, ['image'], 10),
|
||||
},
|
||||
help="Small-sized photo of the brand. It is automatically "\
|
||||
"resized as a 64x64px image, with aspect ratio preserved. "\
|
||||
"Use this field anywhere a small image is required."),
|
||||
}
|
||||
|
||||
|
||||
class fleet_vehicle(osv.Model):
|
||||
|
||||
_inherit = 'mail.thread'
|
||||
|
||||
def _vehicle_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = record.model_id.brand.name + '/' + record.model_id.modelname + ' / ' + record.license_plate
|
||||
return res
|
||||
|
||||
def return_action_to_open(self, cr, uid, ids, context=None):
|
||||
""" This opens the xml view specified in xml_id for the current vehicle """
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('xml_id'):
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet', context['xml_id'], context=context)
|
||||
res['context'] = context
|
||||
res['context'].update({'default_vehicle_id': ids[0]})
|
||||
res['domain'] = [('vehicle_id','=', ids[0])]
|
||||
return res
|
||||
return False
|
||||
|
||||
def act_show_log_cost(self, cr, uid, ids, context=None):
|
||||
""" This opens log view to view and add new log for this vehicle, groupby default to only show effective costs
|
||||
@return: the costs log view
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
res = self.pool.get('ir.actions.act_window').for_xml_id(cr, uid ,'fleet','fleet_vehicle_costs_act', context=context)
|
||||
res['context'] = context
|
||||
res['context'].update({
|
||||
'default_vehicle_id': ids[0],
|
||||
'search_default_parent_false': True
|
||||
})
|
||||
res['domain'] = [('vehicle_id','=', ids[0])]
|
||||
return res
|
||||
|
||||
def _get_odometer(self, cr, uid, ids, odometer_id, arg, context):
|
||||
res = dict.fromkeys(ids, 0)
|
||||
for record in self.browse(cr,uid,ids,context=context):
|
||||
ids = self.pool.get('fleet.vehicle.odometer').search(cr, uid, [('vehicle_id', '=', record.id)], limit=1, order='value desc')
|
||||
if len(ids) > 0:
|
||||
res[record.id] = self.pool.get('fleet.vehicle.odometer').browse(cr, uid, ids[0], context=context).value
|
||||
return res
|
||||
|
||||
def _set_odometer(self, cr, uid, id, name, value, args=None, context=None):
|
||||
if value:
|
||||
date = fields.date.context_today(self, cr, uid, context=context)
|
||||
data = {'value': value, 'date': date, 'vehicle_id': id}
|
||||
return self.pool.get('fleet.vehicle.odometer').create(cr, uid, data, context=context)
|
||||
|
||||
def _search_get_overdue_contract_reminder(self, cr, uid, obj, name, args, context):
|
||||
res = []
|
||||
for field, operator, value in args:
|
||||
assert operator in ('=', '!=', '<>') and value in (True, False), 'Operation not supported'
|
||||
if (operator == '=' and value == True) or (operator in ('<>', '!=') and value == False):
|
||||
search_operator = 'in'
|
||||
else:
|
||||
search_operator = 'not in'
|
||||
today = fields.date.context_today(self, cr, uid, context=context)
|
||||
cr.execute('select cost.vehicle_id, count(contract.id) as contract_number FROM fleet_vehicle_cost cost left join fleet_vehicle_log_contract contract on contract.cost_id = cost.id WHERE contract.expiration_date is not null AND contract.expiration_date < %s AND contract.state IN (\'open\', \'toclose\') GROUP BY cost.vehicle_id', (today,))
|
||||
res_ids = [x[0] for x in cr.fetchall()]
|
||||
res.append(('id', search_operator, res_ids))
|
||||
return res
|
||||
|
||||
def _search_contract_renewal_due_soon(self, cr, uid, obj, name, args, context):
|
||||
res = []
|
||||
for field, operator, value in args:
|
||||
assert operator in ('=', '!=', '<>') and value in (True, False), 'Operation not supported'
|
||||
if (operator == '=' and value == True) or (operator in ('<>', '!=') and value == False):
|
||||
search_operator = 'in'
|
||||
else:
|
||||
search_operator = 'not in'
|
||||
today = fields.date.context_today(self, cr, uid, context=context)
|
||||
datetime_today = datetime.datetime.strptime(today, tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
limit_date = str((datetime_today + relativedelta(days=+15)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT))
|
||||
cr.execute('select cost.vehicle_id, count(contract.id) as contract_number FROM fleet_vehicle_cost cost left join fleet_vehicle_log_contract contract on contract.cost_id = cost.id WHERE contract.expiration_date is not null AND contract.expiration_date > %s AND contract.expiration_date < %s AND contract.state IN (\'open\', \'toclose\') GROUP BY cost.vehicle_id', (today, limit_date))
|
||||
res_ids = [x[0] for x in cr.fetchall()]
|
||||
res.append(('id', search_operator, res_ids))
|
||||
return res
|
||||
|
||||
def _get_contract_reminder_fnc(self, cr, uid, ids, field_names, unknow_none, context=None):
|
||||
res= {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
overdue = False
|
||||
due_soon = False
|
||||
total = 0
|
||||
name = ''
|
||||
for element in record.log_contracts:
|
||||
if element.state in ('open', 'toclose') and element.expiration_date:
|
||||
current_date_str = fields.date.context_today(self, cr, uid, context=context)
|
||||
due_time_str = element.expiration_date
|
||||
current_date = str_to_datetime(current_date_str)
|
||||
due_time = str_to_datetime(due_time_str)
|
||||
diff_time = (due_time-current_date).days
|
||||
if diff_time < 0:
|
||||
overdue = True
|
||||
total += 1
|
||||
if diff_time < 15 and diff_time >= 0:
|
||||
due_soon = True;
|
||||
total += 1
|
||||
if overdue or due_soon:
|
||||
ids = self.pool.get('fleet.vehicle.log.contract').search(cr,uid,[('vehicle_id', '=', record.id), ('state', 'in', ('open', 'toclose'))], limit=1, order='expiration_date asc')
|
||||
if len(ids) > 0:
|
||||
#we display only the name of the oldest overdue/due soon contract
|
||||
name=(self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, ids[0], context=context).cost_subtype.name)
|
||||
|
||||
res[record.id] = {
|
||||
'contract_renewal_overdue': overdue,
|
||||
'contract_renewal_due_soon': due_soon,
|
||||
'contract_renewal_total': (total - 1), #we remove 1 from the real total for display purposes
|
||||
'contract_renewal_name': name,
|
||||
}
|
||||
return res
|
||||
|
||||
def _get_default_state(self, cr, uid, context):
|
||||
try:
|
||||
model, model_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fleet', 'vehicle_state_active')
|
||||
except ValueError:
|
||||
model_id = False
|
||||
return model_id
|
||||
|
||||
_name = 'fleet.vehicle'
|
||||
_description = 'Information on a vehicle'
|
||||
_order= 'license_plate asc'
|
||||
_columns = {
|
||||
'name': fields.function(_vehicle_name_get_fnc, type="char", string='Name', store=True),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'license_plate': fields.char('License Plate', size=32, required=True, help='License plate number of the vehicle (ie: plate number for a car)'),
|
||||
'vin_sn': fields.char('Chassis Number', size=32, help='Unique number written on the vehicle motor (VIN/SN number)'),
|
||||
'driver': fields.many2one('res.partner', 'Driver', help='Driver of the vehicle'),
|
||||
'model_id': fields.many2one('fleet.vehicle.model', 'Model', required=True, help='Model of the vehicle'),
|
||||
'log_fuel': fields.one2many('fleet.vehicle.log.fuel', 'vehicle_id', 'Fuel Logs'),
|
||||
'log_services': fields.one2many('fleet.vehicle.log.services', 'vehicle_id', 'Services Logs'),
|
||||
'log_contracts': fields.one2many('fleet.vehicle.log.contract', 'vehicle_id', 'Contracts'),
|
||||
'acquisition_date': fields.date('Acquisition Date', required=False, help='Date when the vehicle has been bought'),
|
||||
'color': fields.char('Color', size=32, help='Color of the vehicle'),
|
||||
'state': fields.many2one('fleet.vehicle.state', 'State', help='Current state of the vehicle', ondelete="set null"),
|
||||
'location': fields.char('Location', size=128, help='Location of the vehicle (garage, ...)'),
|
||||
'seats': fields.integer('Seats Number', help='Number of seats of the vehicle'),
|
||||
'doors': fields.integer('Doors Number', help='Number of doors of the vehicle'),
|
||||
'tag_ids' :fields.many2many('fleet.vehicle.tag', 'fleet_vehicle_vehicle_tag_rel', 'vehicle_tag_id','tag_id', 'Tags'),
|
||||
'odometer': fields.function(_get_odometer, fnct_inv=_set_odometer, type='float', string='Last Odometer', help='Odometer measure of the vehicle at the moment of this log'),
|
||||
'odometer_unit': fields.selection([('kilometers', 'Kilometers'),('miles','Miles')], 'Odometer Unit', help='Unit of the odometer ',required=True),
|
||||
'transmission': fields.selection([('manual', 'Manual'), ('automatic', 'Automatic')], 'Transmission', help='Transmission Used by the vehicle'),
|
||||
'fuel_type': fields.selection([('gasoline', 'Gasoline'), ('diesel', 'Diesel'), ('electric', 'Electric'), ('hybrid', 'Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle'),
|
||||
'horsepower': fields.integer('Horsepower'),
|
||||
'horsepower_tax': fields.float('Horsepower Taxation'),
|
||||
'power': fields.integer('Power (kW)', help='Power in kW of the vehicle'),
|
||||
'co2': fields.float('CO2 Emissions', help='CO2 emissions of the vehicle'),
|
||||
'image': fields.related('model_id', 'image', type="binary", string="Logo"),
|
||||
'image_medium': fields.related('model_id', 'image_medium', type="binary", string="Logo"),
|
||||
'image_small': fields.related('model_id', 'image_small', type="binary", string="Logo"),
|
||||
'contract_renewal_due_soon': fields.function(_get_contract_reminder_fnc, fnct_search=_search_contract_renewal_due_soon, type="boolean", string='Has Contracts to renew', multi='contract_info'),
|
||||
'contract_renewal_overdue': fields.function(_get_contract_reminder_fnc, fnct_search=_search_get_overdue_contract_reminder, type="boolean", string='Has Contracts Overdued', multi='contract_info'),
|
||||
'contract_renewal_name': fields.function(_get_contract_reminder_fnc, type="text", string='Name of contract to renew soon', multi='contract_info'),
|
||||
'contract_renewal_total': fields.function(_get_contract_reminder_fnc, type="integer", string='Total of contracts due or overdue minus one', multi='contract_info'),
|
||||
'car_value': fields.float('Car Value', help='Value of the bought vehicle'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'doors': 5,
|
||||
'odometer_unit': 'kilometers',
|
||||
'state': _get_default_state,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'log_fuel':[],
|
||||
'log_contracts':[],
|
||||
'log_services':[],
|
||||
'tag_ids':[],
|
||||
'vin_sn':'',
|
||||
})
|
||||
return super(fleet_vehicle, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def on_change_model(self, cr, uid, ids, model_id, context=None):
|
||||
if not model_id:
|
||||
return {}
|
||||
model = self.pool.get('fleet.vehicle.model').browse(cr, uid, model_id, context=context)
|
||||
return {
|
||||
'value': {
|
||||
'image_medium': model.image,
|
||||
}
|
||||
}
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context)
|
||||
vehicle = self.browse(cr, uid, vehicle_id, context=context)
|
||||
self.message_post(cr, uid, [vehicle_id], body=_('Vehicle %s has been added to the fleet!') % (vehicle.license_plate), context=context)
|
||||
return vehicle_id
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
"""
|
||||
This function write an entry in the openchatter whenever we change important information
|
||||
on the vehicle like the model, the drive, the state of the vehicle or its license plate
|
||||
"""
|
||||
for vehicle in self.browse(cr, uid, ids, context):
|
||||
changes = []
|
||||
if 'model_id' in vals and vehicle.model_id.id != vals['model_id']:
|
||||
value = self.pool.get('fleet.vehicle.model').browse(cr,uid,vals['model_id'],context=context).name
|
||||
oldmodel = vehicle.model_id.name or _('None')
|
||||
changes.append(_("Model: from '%s' to '%s'") %(oldmodel, value))
|
||||
if 'driver' in vals and vehicle.driver.id != vals['driver']:
|
||||
value = self.pool.get('res.partner').browse(cr,uid,vals['driver'],context=context).name
|
||||
olddriver = (vehicle.driver.name) or _('None')
|
||||
changes.append(_("Driver: from '%s' to '%s'") %(olddriver, value))
|
||||
if 'state' in vals and vehicle.state.id != vals['state']:
|
||||
value = self.pool.get('fleet.vehicle.state').browse(cr,uid,vals['state'],context=context).name
|
||||
oldstate = vehicle.state.name or _('None')
|
||||
changes.append(_("State: from '%s' to '%s'") %(oldstate, value))
|
||||
if 'license_plate' in vals and vehicle.license_plate != vals['license_plate']:
|
||||
old_license_plate = vehicle.license_plate or _('None')
|
||||
changes.append(_("License Plate: from '%s' to '%s'") %(old_license_plate, vals['license_plate']))
|
||||
|
||||
if len(changes) > 0:
|
||||
self.message_post(cr, uid, [vehicle.id], body=", ".join(changes), context=context)
|
||||
|
||||
vehicle_id = super(fleet_vehicle,self).write(cr, uid, ids, vals, context)
|
||||
return True
|
||||
|
||||
|
||||
class fleet_vehicle_odometer(osv.Model):
|
||||
_name='fleet.vehicle.odometer'
|
||||
_description='Odometer log for a vehicle'
|
||||
_order='date desc'
|
||||
|
||||
def _vehicle_log_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
name = record.vehicle_id.name
|
||||
if record.date:
|
||||
name = name+ ' / '+ str(record.date)
|
||||
res[record.id] = name
|
||||
return res
|
||||
|
||||
def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None):
|
||||
if not vehicle_id:
|
||||
return {}
|
||||
odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit
|
||||
return {
|
||||
'value': {
|
||||
'unit': odometer_unit,
|
||||
}
|
||||
}
|
||||
|
||||
_columns = {
|
||||
'name': fields.function(_vehicle_log_name_get_fnc, type="char", string='Name', store=True),
|
||||
'date': fields.date('Date'),
|
||||
'value': fields.float('Odometer Value', group_operator="max"),
|
||||
'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True),
|
||||
'unit': fields.related('vehicle_id', 'odometer_unit', type="char", string="Unit", readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'date': fields.date.context_today,
|
||||
}
|
||||
|
||||
|
||||
class fleet_vehicle_log_fuel(osv.Model):
|
||||
|
||||
def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None):
|
||||
if not vehicle_id:
|
||||
return {}
|
||||
odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit
|
||||
return {
|
||||
'value': {
|
||||
'odometer_unit': odometer_unit,
|
||||
}
|
||||
}
|
||||
|
||||
def on_change_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None):
|
||||
#need to cast in float because the value receveid from web client maybe an integer (Javascript and JSON do not
|
||||
#make any difference between 3.0 and 3). This cause a problem if you encode, for example, 2 liters at 1.5 per
|
||||
#liter => total is computed as 3.0, then trigger an onchange that recomputes price_per_liter as 3/2=1 (instead
|
||||
#of 3.0/2=1.5)
|
||||
liter = float(liter)
|
||||
price_per_liter = float(price_per_liter)
|
||||
amount = float(amount)
|
||||
if liter > 0 and price_per_liter > 0:
|
||||
return {'value' : {'amount' : liter * price_per_liter,}}
|
||||
elif liter > 0 and amount > 0:
|
||||
return {'value' : {'price_per_liter' : amount / liter,}}
|
||||
elif price_per_liter > 0 and amount > 0:
|
||||
return {'value' : {'liter' : amount / price_per_liter,}}
|
||||
else :
|
||||
return {}
|
||||
|
||||
def on_change_price_per_liter(self, cr, uid, ids, liter, price_per_liter, amount, context=None):
|
||||
#need to cast in float because the value receveid from web client maybe an integer (Javascript and JSON do not
|
||||
#make any difference between 3.0 and 3). This cause a problem if you encode, for example, 2 liters at 1.5 per
|
||||
#liter => total is computed as 3.0, then trigger an onchange that recomputes price_per_liter as 3/2=1 (instead
|
||||
#of 3.0/2=1.5)
|
||||
liter = float(liter)
|
||||
price_per_liter = float(price_per_liter)
|
||||
amount = float(amount)
|
||||
if price_per_liter > 0 and liter > 0:
|
||||
return {'value' : {'amount' : liter * price_per_liter,}}
|
||||
elif price_per_liter > 0 and amount > 0:
|
||||
return {'value' : {'liter' : amount / price_per_liter,}}
|
||||
elif liter > 0 and amount > 0:
|
||||
return {'value' : {'price_per_liter' : amount / liter,}}
|
||||
else :
|
||||
return {}
|
||||
|
||||
def on_change_amount(self, cr, uid, ids, liter, price_per_liter, amount, context=None):
|
||||
#need to cast in float because the value receveid from web client maybe an integer (Javascript and JSON do not
|
||||
#make any difference between 3.0 and 3). This cause a problem if you encode, for example, 2 liters at 1.5 per
|
||||
#liter => total is computed as 3.0, then trigger an onchange that recomputes price_per_liter as 3/2=1 (instead
|
||||
#of 3.0/2=1.5)
|
||||
liter = float(liter)
|
||||
price_per_liter = float(price_per_liter)
|
||||
amount = float(amount)
|
||||
if amount > 0 and liter > 0:
|
||||
return {'value': {'price_per_liter': amount / liter,}}
|
||||
elif amount > 0 and price_per_liter > 0:
|
||||
return {'value': {'liter': amount / price_per_liter,}}
|
||||
elif liter > 0 and price_per_liter > 0:
|
||||
return {'value': {'amount': liter * price_per_liter,}}
|
||||
return {}
|
||||
|
||||
def _get_default_service_type(self, cr, uid, context):
|
||||
try:
|
||||
model, model_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fleet', 'type_service_refueling')
|
||||
except ValueError:
|
||||
model_id = False
|
||||
return model_id
|
||||
|
||||
_name = 'fleet.vehicle.log.fuel'
|
||||
_description = 'Fuel log for vehicles'
|
||||
_inherits = {'fleet.vehicle.cost': 'cost_id'}
|
||||
|
||||
_columns = {
|
||||
'liter': fields.float('Liter'),
|
||||
'price_per_liter': fields.float('Price Per Liter'),
|
||||
'purchaser_id': fields.many2one('res.partner', 'Purchaser', domain="['|',('customer','=',True),('employee','=',True)]"),
|
||||
'inv_ref': fields.char('Invoice Reference', size=64),
|
||||
'vendor_id': fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"),
|
||||
'notes': fields.text('Notes'),
|
||||
'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database
|
||||
}
|
||||
_defaults = {
|
||||
'purchaser_id': lambda self, cr, uid, ctx: uid,
|
||||
'date': fields.date.context_today,
|
||||
'cost_subtype': _get_default_service_type,
|
||||
'cost_type': 'fuel',
|
||||
}
|
||||
|
||||
|
||||
class fleet_vehicle_log_services(osv.Model):
|
||||
|
||||
def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None):
|
||||
if not vehicle_id:
|
||||
return {}
|
||||
odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit
|
||||
return {
|
||||
'value': {
|
||||
'odometer_unit': odometer_unit,
|
||||
}
|
||||
}
|
||||
|
||||
def _get_default_service_type(self, cr, uid, context):
|
||||
try:
|
||||
model, model_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fleet', 'type_service_service_8')
|
||||
except ValueError:
|
||||
model_id = False
|
||||
return model_id
|
||||
|
||||
_inherits = {'fleet.vehicle.cost': 'cost_id'}
|
||||
_name = 'fleet.vehicle.log.services'
|
||||
_description = 'Services for vehicles'
|
||||
_columns = {
|
||||
'purchaser_id': fields.many2one('res.partner', 'Purchaser', domain="['|',('customer','=',True),('employee','=',True)]"),
|
||||
'inv_ref': fields.char('Invoice Reference', size=64),
|
||||
'vendor_id': fields.many2one('res.partner', 'Supplier', domain="[('supplier','=',True)]"),
|
||||
'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database
|
||||
'notes': fields.text('Notes'),
|
||||
}
|
||||
_defaults = {
|
||||
'purchaser_id': lambda self, cr, uid, ctx: uid,
|
||||
'date': fields.date.context_today,
|
||||
'cost_subtype': _get_default_service_type,
|
||||
'cost_type': 'services'
|
||||
}
|
||||
|
||||
|
||||
class fleet_service_type(osv.Model):
|
||||
_name = 'fleet.service.type'
|
||||
_description = 'Type of services available on a vehicle'
|
||||
_columns = {
|
||||
'name': fields.char('Name', required=True, translate=True),
|
||||
'category': fields.selection([('contract', 'Contract'), ('service', 'Service'), ('both', 'Both')], 'Category', required=True, help='Choose wheter the service refer to contracts, vehicle services or both'),
|
||||
}
|
||||
|
||||
|
||||
class fleet_vehicle_log_contract(osv.Model):
|
||||
|
||||
def scheduler_manage_auto_costs(self, cr, uid, context=None):
|
||||
#This method is called by a cron task
|
||||
#It creates costs for contracts having the "recurring cost" field setted, depending on their frequency
|
||||
#For example, if a contract has a reccuring cost of 200 with a weekly frequency, this method creates a cost of 200 on the first day of each week, from the date of the last recurring costs in the database to today
|
||||
#If the contract has not yet any recurring costs in the database, the method generates the recurring costs from the start_date to today
|
||||
#The created costs are associated to a contract thanks to the many2one field contract_id
|
||||
#If the contract has no start_date, no cost will be created, even if the contract has recurring costs
|
||||
vehicle_cost_obj = self.pool.get('fleet.vehicle.cost')
|
||||
d = datetime.datetime.strptime(fields.date.context_today(self, cr, uid, context=context), tools.DEFAULT_SERVER_DATE_FORMAT).date()
|
||||
contract_ids = self.pool.get('fleet.vehicle.log.contract').search(cr, uid, [('state','!=','closed')], offset=0, limit=None, order=None,context=None, count=False)
|
||||
deltas = {'yearly': relativedelta(years=+1), 'monthly': relativedelta(months=+1), 'weekly': relativedelta(weeks=+1), 'daily': relativedelta(days=+1)}
|
||||
for contract in self.pool.get('fleet.vehicle.log.contract').browse(cr, uid, contract_ids, context=context):
|
||||
if not contract.start_date or contract.cost_frequency == 'no':
|
||||
continue
|
||||
found = False
|
||||
last_cost_date = contract.start_date
|
||||
if contract.generated_cost_ids:
|
||||
last_autogenerated_cost_id = vehicle_cost_obj.search(cr, uid, ['&', ('contract_id','=',contract.id), ('auto_generated','=',True)], offset=0, limit=1, order='date desc',context=context, count=False)
|
||||
if last_autogenerated_cost_id:
|
||||
found = True
|
||||
last_cost_date = vehicle_cost_obj.browse(cr, uid, last_autogenerated_cost_id[0], context=context).date
|
||||
startdate = datetime.datetime.strptime(last_cost_date, tools.DEFAULT_SERVER_DATE_FORMAT).date()
|
||||
if found:
|
||||
startdate += deltas.get(contract.cost_frequency)
|
||||
while (startdate < d) & (startdate < datetime.datetime.strptime(contract.expiration_date, tools.DEFAULT_SERVER_DATE_FORMAT).date()):
|
||||
data = {
|
||||
'amount': contract.cost_generated,
|
||||
'date': startdate.strftime(tools.DEFAULT_SERVER_DATE_FORMAT),
|
||||
'vehicle_id': contract.vehicle_id.id,
|
||||
'cost_subtype': contract.cost_subtype.id,
|
||||
'contract_id': contract.id,
|
||||
'auto_generated': True
|
||||
}
|
||||
cost_id = self.pool.get('fleet.vehicle.cost').create(cr, uid, data, context=context)
|
||||
startdate += deltas.get(contract.cost_frequency)
|
||||
return True
|
||||
|
||||
def scheduler_manage_contract_expiration(self, cr, uid, context=None):
|
||||
#This method is called by a cron task
|
||||
#It manages the state of a contract, possibly by posting a message on the vehicle concerned and updating its status
|
||||
datetime_today = datetime.datetime.strptime(fields.date.context_today(self, cr, uid, context=context), tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
limit_date = (datetime_today + relativedelta(days=+15)).strftime(tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
ids = self.search(cr, uid, ['&', ('state', '=', 'open'), ('expiration_date', '<', limit_date)], offset=0, limit=None, order=None, context=context, count=False)
|
||||
res = {}
|
||||
for contract in self.browse(cr, uid, ids, context=context):
|
||||
if contract.vehicle_id.id in res:
|
||||
res[contract.vehicle_id.id] += 1
|
||||
else:
|
||||
res[contract.vehicle_id.id] = 1
|
||||
|
||||
for vehicle, value in res.items():
|
||||
self.pool.get('fleet.vehicle').message_post(cr, uid, vehicle, body=_('%s contract(s) need(s) to be renewed and/or closed!') % (str(value)), context=context)
|
||||
return self.write(cr, uid, ids, {'state': 'toclose'}, context=context)
|
||||
|
||||
def run_scheduler(self, cr, uid, context=None):
|
||||
self.scheduler_manage_auto_costs(cr, uid, context=context)
|
||||
self.scheduler_manage_contract_expiration(cr, uid, context=context)
|
||||
return True
|
||||
|
||||
def _vehicle_contract_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
name = record.vehicle_id.name
|
||||
if record.cost_subtype.name:
|
||||
name += ' / '+ record.cost_subtype.name
|
||||
if record.date:
|
||||
name += ' / '+ record.date
|
||||
res[record.id] = name
|
||||
return res
|
||||
|
||||
def on_change_vehicle(self, cr, uid, ids, vehicle_id, context=None):
|
||||
if not vehicle_id:
|
||||
return {}
|
||||
odometer_unit = self.pool.get('fleet.vehicle').browse(cr, uid, vehicle_id, context=context).odometer_unit
|
||||
return {
|
||||
'value': {
|
||||
'odometer_unit': odometer_unit,
|
||||
}
|
||||
}
|
||||
|
||||
def compute_next_year_date(self, strdate):
|
||||
oneyear = datetime.timedelta(days=365)
|
||||
curdate = str_to_datetime(strdate)
|
||||
return datetime.datetime.strftime(curdate + oneyear, tools.DEFAULT_SERVER_DATE_FORMAT)
|
||||
|
||||
def on_change_start_date(self, cr, uid, ids, strdate, enddate, context=None):
|
||||
if (strdate):
|
||||
return {'value': {'expiration_date': self.compute_next_year_date(strdate),}}
|
||||
return {}
|
||||
|
||||
def get_days_left(self, cr, uid, ids, prop, unknow_none, context=None):
|
||||
"""return a dict with as value for each contract an integer
|
||||
if contract is in an open state and is overdue, return 0
|
||||
if contract is in a closed state, return -1
|
||||
otherwise return the number of days before the contract expires
|
||||
"""
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
if (record.expiration_date and (record.state == 'open' or record.state == 'toclose')):
|
||||
today = str_to_datetime(time.strftime(tools.DEFAULT_SERVER_DATE_FORMAT))
|
||||
renew_date = str_to_datetime(record.expiration_date)
|
||||
diff_time = (renew_date-today).days
|
||||
res[record.id] = diff_time > 0 and diff_time or 0
|
||||
else:
|
||||
res[record.id] = -1
|
||||
return res
|
||||
|
||||
def act_renew_contract(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1, "This operation should only be done for 1 single contract at a time, as it it suppose to open a window as result"
|
||||
for element in self.browse(cr, uid, ids, context=context):
|
||||
#compute end date
|
||||
startdate = str_to_datetime(element.start_date)
|
||||
enddate = str_to_datetime(element.expiration_date)
|
||||
diffdate = (enddate - startdate)
|
||||
default = {
|
||||
'date': fields.date.context_today(self, cr, uid, context=context),
|
||||
'start_date': datetime.datetime.strftime(str_to_datetime(element.expiration_date) + datetime.timedelta(days=1), tools.DEFAULT_SERVER_DATE_FORMAT),
|
||||
'expiration_date': datetime.datetime.strftime(enddate + diffdate, tools.DEFAULT_SERVER_DATE_FORMAT),
|
||||
}
|
||||
newid = super(fleet_vehicle_log_contract, self).copy(cr, uid, element.id, default, context=context)
|
||||
mod, modid = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fleet', 'fleet_vehicle_log_contract_form')
|
||||
return {
|
||||
'name':_("Renew Contract"),
|
||||
'view_mode': 'form',
|
||||
'view_id': modid,
|
||||
'view_type': 'tree,form',
|
||||
'res_model': 'fleet.vehicle.log.contract',
|
||||
'type': 'ir.actions.act_window',
|
||||
'nodestroy': True,
|
||||
'domain': '[]',
|
||||
'res_id': newid,
|
||||
'context': {'active_id':newid},
|
||||
}
|
||||
|
||||
def _get_default_contract_type(self, cr, uid, context=None):
|
||||
try:
|
||||
model, model_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fleet', 'type_contract_leasing')
|
||||
except ValueError:
|
||||
model_id = False
|
||||
return model_id
|
||||
|
||||
def on_change_indic_cost(self, cr, uid, ids, cost_ids, context=None):
|
||||
totalsum = 0.0
|
||||
for element in cost_ids:
|
||||
if element and len(element) == 3 and element[2] is not False:
|
||||
totalsum += element[2].get('amount', 0.0)
|
||||
return {
|
||||
'value': {
|
||||
'sum_cost': totalsum,
|
||||
}
|
||||
}
|
||||
|
||||
def _get_sum_cost(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
for contract in self.browse(cr, uid, ids, context=context):
|
||||
totalsum = 0
|
||||
for cost in contract.cost_ids:
|
||||
totalsum += cost.amount
|
||||
res[contract.id] = totalsum
|
||||
return res
|
||||
|
||||
_inherits = {'fleet.vehicle.cost': 'cost_id'}
|
||||
_name = 'fleet.vehicle.log.contract'
|
||||
_description = 'Contract information on a vehicle'
|
||||
_order='state desc,expiration_date'
|
||||
_columns = {
|
||||
'name': fields.function(_vehicle_contract_name_get_fnc, type="text", string='Name', store=True),
|
||||
'start_date': fields.date('Contract Start Date', help='Date when the coverage of the contract begins'),
|
||||
'expiration_date': fields.date('Contract Expiration Date', help='Date when the coverage of the contract expirates (by default, one year after begin date)'),
|
||||
'days_left': fields.function(get_days_left, type='integer', string='Warning Date'),
|
||||
'insurer_id' :fields.many2one('res.partner', 'Supplier'),
|
||||
'purchaser_id': fields.many2one('res.partner', 'Contractor', help='Person to which the contract is signed for'),
|
||||
'ins_ref': fields.char('Contract Reference', size=64),
|
||||
'state': fields.selection([('open', 'In Progress'), ('toclose','To Close'), ('closed', 'Terminated')], 'Status', readonly=True, help='Choose wheter the contract is still valid or not'),
|
||||
'notes': fields.text('Terms and Conditions', help='Write here all supplementary informations relative to this contract'),
|
||||
'cost_generated': fields.float('Recurring Cost Amount', help="Costs paid at regular intervals, depending on the cost frequency. If the cost frequency is set to unique, the cost will be logged at the start date"),
|
||||
'cost_frequency': fields.selection([('no','No'), ('daily', 'Daily'), ('weekly','Weekly'), ('monthly','Monthly'), ('yearly','Yearly')], 'Recurring Cost Frequency', help='Frequency of the recuring cost', required=True),
|
||||
'generated_cost_ids': fields.one2many('fleet.vehicle.cost', 'contract_id', 'Generated Costs', ondelete='cascade'),
|
||||
'sum_cost': fields.function(_get_sum_cost, type='float', string='Indicative Costs Total'),
|
||||
'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database
|
||||
}
|
||||
_defaults = {
|
||||
'purchaser_id': lambda self, cr, uid, ctx: uid,
|
||||
'date': fields.date.context_today,
|
||||
'start_date': fields.date.context_today,
|
||||
'state':'open',
|
||||
'expiration_date': lambda self, cr, uid, ctx: self.compute_next_year_date(fields.date.context_today(self, cr, uid, context=ctx)),
|
||||
'cost_frequency': 'no',
|
||||
'cost_subtype': _get_default_contract_type,
|
||||
'cost_type': 'contract',
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
today = fields.date.context_today(self, cr, uid, context=context)
|
||||
default['date'] = today
|
||||
default['start_date'] = today
|
||||
default['expiration_date'] = self.compute_next_year_date(today)
|
||||
default['ins_ref'] = ''
|
||||
default['state'] = 'open'
|
||||
default['notes'] = ''
|
||||
return super(fleet_vehicle_log_contract, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def contract_close(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state': 'closed'}, context=context)
|
||||
|
||||
def contract_open(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state': 'open'}, context=context)
|
||||
|
||||
class fleet_contract_state(osv.Model):
|
||||
_name = 'fleet.contract.state'
|
||||
_description = 'Contains the different possible status of a leasing contract'
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Contract Status', size=64, required=True),
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_fuel_graph">
|
||||
<field name="name">Fuel Costs by Month</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">['&',('parent_id','=',False),('cost_type','=','fuel')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_services_graph">
|
||||
<field name="name">Services Costs by Month</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_graph" />
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">['&',('parent_id','=',False),('cost_type','=','services')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_contract_graph">
|
||||
<field name="name">Contracts Costs by Month</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">['&',('parent_id','=',False),('cost_type','=','contract')]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_vehicle_costs_graph">
|
||||
<field name="name">Costs by Month</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_vehicle_kanban">
|
||||
<field name="name">Vehicles with alerts</field>
|
||||
<field name="res_model">fleet.vehicle</field>
|
||||
<field name="view_id" ref="fleet_vehicle_kanban"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="domain">['|',('contract_renewal_due_soon','=',True),('contract_renewal_overdue','=',True)]</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
Here are displayed vehicles for which one or more contracts need to be renewed. If you see this message, then there is no contracts to renew.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_reporting_costs">
|
||||
<field name="name">Costs Analysis</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_tree"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="context">{"search_default_parent_false" : True,"search_default_groupby_year" : True,"search_default_groupby_cost_type" : True,"search_default_groupby_cost_subtype" : True, "search_default_groupby_vehicle_id" : True,}</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
OpenERP helps you managing the costs for your different vehicles
|
||||
Costs are generally created from services and contract and appears here.
|
||||
</p>
|
||||
<p>
|
||||
Thanks to the different filters, OpenERP can only print the effective
|
||||
costs, sort them by type and by vehicle.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_fleet_reporting_costs_non_effective">
|
||||
<field name="name">Indicative Costs Analysis</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_id" ref="fleet_vehicle_costs_tree"></field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="context">{"search_default_parent_true" : True,"search_default_groupby_cost_subtype" : True,"search_default_groupby_cost_type" : True,"search_default_groupby_parent_id" : True,}</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
OpenERP helps you managing the costs for your different vehicles
|
||||
Costs are generally created from services and contract and appears here.
|
||||
</p>
|
||||
<p>
|
||||
Thanks to the different filters, OpenERP can only print the effective
|
||||
costs, sort them by type and by vehicle.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="board_fleet_form" model="ir.ui.view">
|
||||
<field name="name">board.fleet.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fleet Dashboard" version="7.0">
|
||||
<board style="2-1">
|
||||
<column>
|
||||
<action string="Vehicles With Alerts" name="%(fleet.action_fleet_vehicle_kanban)d" view_mode="kanban"/>
|
||||
<action string="Costs by Month" name="%(fleet.action_fleet_vehicle_costs_graph)d" view_mode="graph,tree"/>
|
||||
</column>
|
||||
<column>
|
||||
<action string="Fuel Costs" name="%(fleet.action_fleet_vehicle_log_fuel_graph)d" view_mode="graph,tree"/>
|
||||
<action string="Services Costs" name="%(fleet.action_fleet_vehicle_log_services_graph)d" view_mode="graph,tree"/>
|
||||
<action string="Contracts Costs" name="%(fleet.action_fleet_vehicle_log_contract_graph)d" view_mode="graph,tree"/>
|
||||
</column>
|
||||
</board>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="open_board_fleet" model="ir.actions.act_window">
|
||||
<field name="name">Fleet</field>
|
||||
<field name="res_model">board.board</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="usage">menu</field>
|
||||
<field name="view_id" ref="board_fleet_form"/>
|
||||
<field name="help" type="html">
|
||||
<div class="oe_empty_custom_dashboard">
|
||||
<p>
|
||||
<b>Fleet dashboard is empty.</b>
|
||||
</p><p>
|
||||
To add your first report into this dashboard, go to any
|
||||
menu, switch to list or graph view, and click <i>'Add to
|
||||
Dashboard'</i> in the extended search options.
|
||||
</p><p>
|
||||
You can filter and group data before inserting into the
|
||||
dashboard using the search options.
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_fleet_dashboard"
|
||||
parent="base.menu_reporting_dashboard"
|
||||
action="open_board_fleet"
|
||||
sequence="50"/>
|
||||
|
||||
<menuitem name="Fleet" parent="base.menu_reporting" id="menu_fleet_reporting" sequence="50" />
|
||||
|
||||
<menuitem id="menu_fleet_reporting_costs"
|
||||
parent="menu_fleet_reporting"
|
||||
action="action_fleet_reporting_costs"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_fleet_reporting_indicative_costs"
|
||||
parent="menu_fleet_reporting"
|
||||
action="action_fleet_reporting_costs_non_effective"
|
||||
sequence="2"/>
|
||||
</data>
|
||||
</openerp>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,440 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
<!--
|
||||
<record forcecreate="True" id="ir_cron_service_services_reminders" model="ir.cron">
|
||||
<field name="name">Creation of Vehicle services and Services renewals reminders</field>
|
||||
<field eval="True" name="active" />
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'fleet.vehicle'" name="model" />
|
||||
<field eval="'run_scheduler'" name="function" />
|
||||
<field eval="'()'" name="args" />
|
||||
</record>
|
||||
-->
|
||||
|
||||
<record forcecreate="True" id="ir_cron_contract_costs_generator" model="ir.cron">
|
||||
<field name="name">Generation of contracts costs based on the costs frequency</field>
|
||||
<field eval="True" name="active" />
|
||||
<field name="user_id" ref="base.user_root" />
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall" />
|
||||
<field eval="'fleet.vehicle.log.contract'" name="model" />
|
||||
<field eval="'run_scheduler'" name="function" />
|
||||
<field eval="'()'" name="args" />
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_1" model="fleet.service.type">
|
||||
<field name="name">Calculation Benefit In Kind</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_2" model="fleet.service.type">
|
||||
<field name="name">Depreciation and Interests</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_3" model="fleet.service.type">
|
||||
<field name="name">Tax roll</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_5" model="fleet.service.type">
|
||||
<field name="name">Summer tires</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_6" model="fleet.service.type">
|
||||
<field name="name">Snow tires</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_7" model="fleet.service.type">
|
||||
<field name="name">Summer tires</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_8" model="fleet.service.type">
|
||||
<field name="name">Repair and maintenance</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_9" model="fleet.service.type">
|
||||
<field name="name">Assistance</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_10" model="fleet.service.type">
|
||||
<field name="name">Replacement Vehicle</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_11" model="fleet.service.type">
|
||||
<field name="name">Management Fee</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_12" model="fleet.service.type">
|
||||
<field name="name">Rent (Excluding VAT)</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_13" model="fleet.service.type">
|
||||
<field name="name">Entry into service tax</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_14" model="fleet.service.type">
|
||||
<field name="name">Total expenses (Excluding VAT)</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_15" model="fleet.service.type">
|
||||
<field name="name">Residual value (Excluding VAT)</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_16" model="fleet.service.type">
|
||||
<field name="name">Options</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_17" model="fleet.service.type">
|
||||
<field name="name">Emissions</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_18" model="fleet.service.type">
|
||||
<field name="name">Touring Assistance</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_service_19" model="fleet.service.type">
|
||||
<field name="name">Residual value in %</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_1" model="fleet.service.type">
|
||||
<field name="name">A/C Compressor Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_2" model="fleet.service.type">
|
||||
<field name="name">A/C Condenser Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_3" model="fleet.service.type">
|
||||
<field name="name">A/C Diagnosis</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_4" model="fleet.service.type">
|
||||
<field name="name">A/C Evaporator Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_5" model="fleet.service.type">
|
||||
<field name="name">A/C Recharge</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_6" model="fleet.service.type">
|
||||
<field name="name">Air Filter Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_7" model="fleet.service.type">
|
||||
<field name="name">Alternator Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_8" model="fleet.service.type">
|
||||
<field name="name">Ball Joint Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_9" model="fleet.service.type">
|
||||
<field name="name">Battery Inspection</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_10" model="fleet.service.type">
|
||||
<field name="name">Battery Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_11" model="fleet.service.type">
|
||||
<field name="name">Brake Caliper Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_12" model="fleet.service.type">
|
||||
<field name="name">Brake Inspection</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_13" model="fleet.service.type">
|
||||
<field name="name">Brake Pad(s) Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_14" model="fleet.service.type">
|
||||
<field name="name">Car Wash</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_15" model="fleet.service.type">
|
||||
<field name="name">Catalytic Converter Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_16" model="fleet.service.type">
|
||||
<field name="name">Charging System Diagnosis</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_17" model="fleet.service.type">
|
||||
<field name="name">Door Window Motor/Regulator Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_18" model="fleet.service.type">
|
||||
<field name="name">Engine Belt Inspection</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_19" model="fleet.service.type">
|
||||
<field name="name">Engine Coolant Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_20" model="fleet.service.type">
|
||||
<field name="name">Engine/Drive Belt(s) Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_21" model="fleet.service.type">
|
||||
<field name="name">Exhaust Manifold Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_22" model="fleet.service.type">
|
||||
<field name="name">Fuel Injector Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_23" model="fleet.service.type">
|
||||
<field name="name">Fuel Pump Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_24" model="fleet.service.type">
|
||||
<field name="name">Head Gasket(s) Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_25" model="fleet.service.type">
|
||||
<field name="name">Heater Blower Motor Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_26" model="fleet.service.type">
|
||||
<field name="name">Heater Control Valve Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_27" model="fleet.service.type">
|
||||
<field name="name">Heater Core Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_28" model="fleet.service.type">
|
||||
<field name="name">Heater Hose Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_29" model="fleet.service.type">
|
||||
<field name="name">Ignition Coil Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_30" model="fleet.service.type">
|
||||
<field name="name">Intake Manifold Gasket Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_31" model="fleet.service.type">
|
||||
<field name="name">Oil Change</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_32" model="fleet.service.type">
|
||||
<field name="name">Oil Pump Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_33" model="fleet.service.type">
|
||||
<field name="name">Other Maintenance</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_34" model="fleet.service.type">
|
||||
<field name="name">Oxygen Sensor Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_35" model="fleet.service.type">
|
||||
<field name="name">Power Steering Hose Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_36" model="fleet.service.type">
|
||||
<field name="name">Power Steering Pump Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_37" model="fleet.service.type">
|
||||
<field name="name">Radiator Repair</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_38" model="fleet.service.type">
|
||||
<field name="name">Resurface Rotors</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_39" model="fleet.service.type">
|
||||
<field name="name">Rotate Tires</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_40" model="fleet.service.type">
|
||||
<field name="name">Rotor Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_41" model="fleet.service.type">
|
||||
<field name="name">Spark Plug Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_42" model="fleet.service.type">
|
||||
<field name="name">Starter Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_43" model="fleet.service.type">
|
||||
<field name="name">Thermostat Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_44" model="fleet.service.type">
|
||||
<field name="name">Tie Rod End Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_45" model="fleet.service.type">
|
||||
<field name="name">Tire Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_46" model="fleet.service.type">
|
||||
<field name="name">Tire Service</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_47" model="fleet.service.type">
|
||||
<field name="name">Transmission Filter Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_48" model="fleet.service.type">
|
||||
<field name="name">Transmission Fluid Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_49" model="fleet.service.type">
|
||||
<field name="name">Transmission Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_50" model="fleet.service.type">
|
||||
<field name="name">Water Pump Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_51" model="fleet.service.type">
|
||||
<field name="name">Wheel Alignment</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_52" model="fleet.service.type">
|
||||
<field name="name">Wheel Bearing Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_53" model="fleet.service.type">
|
||||
<field name="name">Windshield Wiper(s) Replacement</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="type_contract_omnium" model="fleet.service.type">
|
||||
<field name="name">Omnium</field>
|
||||
<field name="category">contract</field>
|
||||
</record>
|
||||
|
||||
<record id="type_contract_leasing" model="fleet.service.type">
|
||||
<field name="name">Leasing</field>
|
||||
<field name="category">contract</field>
|
||||
</record>
|
||||
|
||||
<record id="type_contract_repairing" model="fleet.service.type">
|
||||
<field name="name">Repairing</field>
|
||||
<field name="category">both</field>
|
||||
</record>
|
||||
|
||||
<record id="type_service_refueling" model="fleet.service.type">
|
||||
<field name="name">Refueling</field>
|
||||
<field name="category">service</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_junior" model="fleet.vehicle.tag" >
|
||||
<field name="name">Junior</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_senior" model="fleet.vehicle.tag" >
|
||||
<field name="name">Senior</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_leasing" model="fleet.vehicle.tag" >
|
||||
<field name="name">Employee Car</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_purchased" model="fleet.vehicle.tag" >
|
||||
<field name="name">Purchased</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_compact" model="fleet.vehicle.tag" >
|
||||
<field name="name">Compact</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_sedan" model="fleet.vehicle.tag" >
|
||||
<field name="name">Sedan</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_convertible" model="fleet.vehicle.tag" >
|
||||
<field name="name">Convertible</field>
|
||||
</record>
|
||||
|
||||
<record id="vehicle_tag_break" model="fleet.vehicle.tag" >
|
||||
<field name="name">Break</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,906 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model='ir.ui.view' id='fleet_vehicle_model_form'>
|
||||
<field name="name">fleet.vehicle.model.form</field>
|
||||
<field name="model">fleet.vehicle.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Model" version="7.0">
|
||||
<sheet>
|
||||
<field name="image_medium" widget='image' class="oe_left oe_avatar"/>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="brand" on_change="on_change_brand(brand)"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="modelname" />
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Vendors">
|
||||
<field name="vendors" widget="many2many_kanban"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model='ir.ui.view' id='fleet_vehicle_model_tree'>
|
||||
<field name="name">fleet.vehicle.model.tree</field>
|
||||
<field name="model">fleet.vehicle.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Models" version="7.0">
|
||||
<field name="brand" />
|
||||
<field name="modelname" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_model_act'>
|
||||
<field name="name">Vehicle Model</field>
|
||||
<field name="res_model">fleet.vehicle.model</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new model.
|
||||
</p><p>
|
||||
You can define several models (e.g. A3, A4) for each brand (Audi).
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_model_brand_tree'>
|
||||
<field name="name">fleet.vehicle.model.brand.tree</field>
|
||||
<field name="model">fleet.vehicle.model.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Model Brand" version="7.0">
|
||||
<field name="name" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_model_brand_form'>
|
||||
<field name="name">fleet.vehicle.model.brand.form</field>
|
||||
<field name="model">fleet.vehicle.model.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Model Brand" version="7.0">
|
||||
<sheet>
|
||||
<group>
|
||||
<div>
|
||||
<field name="image_medium" widget="image" class="oe_left oe_avatar"/>
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="name" class="oe_inline" />
|
||||
</h1>
|
||||
</div>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_model_brand_kanban'>
|
||||
<field name="name">fleet.vehicle.model.brandkanban</field>
|
||||
<field name="model">fleet.vehicle.model.brand</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="name" />
|
||||
<field name="image" />
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<a type="open" href="#" class="oe_kanban_action oe_kanban_action_a">
|
||||
<img t-att-src="kanban_image('fleet.vehicle.model.brand', 'image_small', record.id.value)" class="oe_employee_picture"/>
|
||||
</a>
|
||||
<div style="text-align:center;">
|
||||
<h4 class="oe_partner_heading">
|
||||
<a type="open">
|
||||
<field name="name"/>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('.oe_picture').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_employee_picture_wide') } });
|
||||
</script>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_model_brand_act'>
|
||||
<field name="name">Model brand of Vehicle</field>
|
||||
<field name="res_model">fleet.vehicle.model.brand</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new brand.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_state_tree'>
|
||||
<field name="name">fleet.vehicle.state.tree</field>
|
||||
<field name="model">fleet.vehicle.state</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="State" version="7.0" editable="bottom">
|
||||
<field name="sequence" widget="handler" invisible="1"/>
|
||||
<field name="name" />
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_state_act'>
|
||||
<field name="name">States of Vehicle</field>
|
||||
<field name="res_model">fleet.vehicle.state</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a vehicule status.
|
||||
</p><p>
|
||||
You can customize available status to track the evolution of
|
||||
each vehicule. Example: Active, Being Repaired, Sold.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Fleet" id="menu_root" sequence="70" />
|
||||
<menuitem name="Configuration" parent="menu_root" id="fleet_configuration" sequence="3" />
|
||||
<menuitem action="fleet_vehicle_model_act" parent="fleet_configuration" id="fleet_vehicle_model_menu" groups="base.group_no_one"/>
|
||||
<menuitem action="fleet_vehicle_model_brand_act" parent="fleet_configuration" id="fleet_vehicle_model_brand_menu" groups="base.group_no_one"/>
|
||||
<menuitem action="fleet_vehicle_state_act" parent="fleet_configuration" id="fleet_vehicle_state_menu" />
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_form'>
|
||||
<field name="name">fleet.vehicle.form</field>
|
||||
<field name="model">fleet.vehicle</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Vehicle" version="7.0">
|
||||
<header>
|
||||
<field name="state" widget="statusbar" clickable="True" />
|
||||
</header>
|
||||
<sheet>
|
||||
<field name="image_medium" widget='image' class="oe_left oe_avatar"/>
|
||||
<div class="oe_title">
|
||||
<label for="model_id" class="oe_edit_only"/>
|
||||
<h1>
|
||||
<field name="model_id" class="oe_inline" on_change="on_change_model(model_id)"/>
|
||||
</h1>
|
||||
<label for="license_plate" class="oe_edit_only"/>
|
||||
<h2>
|
||||
<field name="license_plate" class="oe_inline"/>
|
||||
</h2>
|
||||
<label for="tag_ids" class="oe_edit_only"/>
|
||||
<field name="tag_ids" widget="many2many_tags" />
|
||||
</div>
|
||||
<div class="oe_right oe_button_box">
|
||||
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_contract_act'}" string="Contracts" help="show the contract for this vehicle" />
|
||||
<button name="act_show_log_cost" type="object" string="Costs" help="show all the costs for this vehicle" />
|
||||
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_services_act'}" string="Services" help="show the services logs for this vehicle" />
|
||||
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_log_fuel_act'}" string="Fuel Logs" help="show the fuel logs for this vehicle" />
|
||||
<button name="return_action_to_open" type="object" context="{'xml_id':'fleet_vehicle_odometer_act'}" string="Odometer Logs" help="show the odometer logs for this vehicle" />
|
||||
</div>
|
||||
<group col="2" string="General Properties">
|
||||
<group >
|
||||
<field name="driver" />
|
||||
<field name="location" />
|
||||
<field name="vin_sn" />
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group >
|
||||
<label for="odometer" />
|
||||
<div>
|
||||
<field name="odometer" class="oe_inline"/>
|
||||
<field name="odometer_unit" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="acquisition_date" />
|
||||
<field name="car_value" />
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group string="Additional Properties">
|
||||
<field name="seats" />
|
||||
<field name="doors" />
|
||||
<field name="color" />
|
||||
</group>
|
||||
<group string="Engine Options">
|
||||
<field name="transmission" />
|
||||
<field name="fuel_type" />
|
||||
<field name="co2" />
|
||||
<field name="horsepower" />
|
||||
<field name="horsepower_tax" />
|
||||
<field name="power" />
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids" widget="mail_thread" options='{"thread_level": 1}'/>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record model='ir.ui.view' id='fleet_vehicle_tree'>
|
||||
<field name="name">fleet.vehicle.tree</field>
|
||||
<field name="model">fleet.vehicle</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Vehicle" version="7.0" colors="orange:contract_renewal_due_soon and not contract_renewal_overdue;red:contract_renewal_overdue">
|
||||
<field name="license_plate" />
|
||||
<field name="model_id" />
|
||||
<field name="driver" />
|
||||
<field name="vin_sn" />
|
||||
<field name="acquisition_date" />
|
||||
<field name="state"/>
|
||||
<field name="odometer" />
|
||||
<field name="odometer_unit" />
|
||||
<field name="contract_renewal_due_soon" invisible="1"/>
|
||||
<field name="contract_renewal_overdue" invisible="1" />
|
||||
<field name="contract_renewal_total" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_search">
|
||||
<field name="name">fleet.vehicle.search</field>
|
||||
<field name="model">fleet.vehicle</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="All vehicles">
|
||||
<field name="name" filter_domain="['|', ('name','ilike',self), ('license_plate','ilike',self)]" string="Vehicle"/>
|
||||
<field name="driver"/>
|
||||
<field name="tag_ids"/>
|
||||
<field name="location"/>
|
||||
<field name="state" />
|
||||
<field name="state" />
|
||||
<filter name="alert_true" domain="['|',('contract_renewal_due_soon','=',True),('contract_renewal_overdue','=',True)]" string="Has Alert(s)"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_kanban'>
|
||||
<field name="name">fleet.vehicle.kanban</field>
|
||||
<field name="model">fleet.vehicle</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<field name="license_plate" />
|
||||
<field name="model_id" />
|
||||
<field name="driver" />
|
||||
<field name="location" />
|
||||
<field name="state" />
|
||||
|
||||
<field name="image" />
|
||||
<field name="tag_ids" />
|
||||
<field name="contract_renewal_due_soon" />
|
||||
<field name="contract_renewal_overdue" />
|
||||
<field name="contract_renewal_name" />
|
||||
<field name="contract_renewal_total" />
|
||||
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_vignette oe_semantic_html_override">
|
||||
<a type="open" href="#" class="oe_kanban_action oe_kanban_action_a">
|
||||
<img t-att-src="kanban_image('fleet.vehicle', 'image_small', record.id.value)"/>
|
||||
</a>
|
||||
<div class="oe_kanban_details">
|
||||
<h4 class="oe_partner_heading">
|
||||
<a type="open">
|
||||
<field name="license_plate"/><br/>
|
||||
<field name="model_id" />
|
||||
</a>
|
||||
</h4>
|
||||
<t t-if="record.contract_renewal_due_soon.raw_value and !record.contract_renewal_overdue.raw_value">
|
||||
<a data-type="object" data-name="return_action_to_open" href="#" class="oe_kanban_action oe_kanban_action_a" data-context='{"xml_id":"fleet_vehicle_log_contract_act"}'>
|
||||
<span class="oe_tag oe_kanban_color_3"><field name="contract_renewal_name" />
|
||||
<t t-if="record.contract_renewal_total.raw_value > 0"> and <field name="contract_renewal_total" /> other(s) </t>
|
||||
</span>
|
||||
</a>
|
||||
</t>
|
||||
|
||||
<t t-if="record.contract_renewal_overdue.raw_value">
|
||||
<a data-type="object" data-name="return_action_to_open" href="#" class="oe_kanban_action oe_kanban_action_a" data-context='{"xml_id":"fleet_vehicle_log_contract_act"}'>
|
||||
<span class="oe_tag oe_kanban_color_2"><field name="contract_renewal_name" />
|
||||
<t t-if="record.contract_renewal_total.raw_value > 0"> and <field name="contract_renewal_total" /> other(s) </t>
|
||||
</span>
|
||||
</a>
|
||||
</t>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<t t-if="record.driver.raw_value"><field name="driver"/></t>
|
||||
</li>
|
||||
<li>
|
||||
<t t-if="record.location.raw_value"><field name="location"/></t>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="oe_kanban_partner_categories">
|
||||
<span class="oe_kanban_list_many2many">
|
||||
<div modifiers="{}" name="tag_ids" class="oe_form_field oe_tags" model="fleet.vehicle.tag" t-att-data="record.tag_ids.raw_value" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_act'>
|
||||
<field name="name">Vehicles</field>
|
||||
<field name="res_model">fleet.vehicle</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new vehicle.
|
||||
</p><p>
|
||||
You will be able to manage your fleet by keeping track of the
|
||||
contracts, services, fixed and recurring costs, odometers and
|
||||
fuel logs associated to each vehicle.
|
||||
</p><p>
|
||||
OpenERP will warn you when services or contract have to be
|
||||
renewed.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Vehicles" parent="menu_root" id="fleet_vehicles" sequence="2" />
|
||||
<menuitem action="fleet_vehicle_act" parent="fleet_vehicles" id="fleet_vehicle_menu" />
|
||||
|
||||
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_contract_form'>
|
||||
<field name="name">fleet.vehicle.log_contract.form</field>
|
||||
<field name="model">fleet.vehicle.log.contract</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contract logs" version="7.0">
|
||||
<header>
|
||||
<button modifiers="{'invisible': [['state', '=', 'closed']]}" name="contract_close" states="open" type="object" class="oe_highlight" string="Terminate Contract"/>
|
||||
<button modifiers="{'invisible': [['state', '=', 'closed']]}" name="contract_close" states="toclose" type="object" class="oe_highlight" string="Terminate Contract"/>
|
||||
<button modifiers="{'invisible': [['state', 'not in', ['closed']]]}" name="contract_open" states="closed" type="object" class="oe_highlight" string="Set Contract In Progress"/>
|
||||
<button class="oe_highlight" name="act_renew_contract" type="object" string="Renew Contract" help="Create a new contract automatically with all the same informations except for the date that will start at the end of current contract" />
|
||||
<field name="state" widget="statusbar" />
|
||||
</header>
|
||||
<sheet>
|
||||
<group col="2">
|
||||
<group string="Contract details">
|
||||
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
|
||||
<field name="cost_subtype" required="1" domain="['|',('category','=','contract'),('category','=','both')]"/>
|
||||
<field name="amount" string="Activation Cost"/>
|
||||
<label for="cost_generated"/>
|
||||
<div>
|
||||
<field name="cost_generated" class="oe_inline" attrs="{'invisible': [('cost_frequency','=','no')]}" />
|
||||
<field name="cost_frequency" class="oe_inline" />
|
||||
</div>
|
||||
</group>
|
||||
<group string="Odometer details">
|
||||
<label for="odometer"/>
|
||||
<div>
|
||||
<field name="odometer" class="oe_inline"/>
|
||||
<field name="odometer_unit" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="date" string="Invoice Date"/>
|
||||
<field name="start_date"/>
|
||||
<field name="expiration_date" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="insurer_id" />
|
||||
<field name="purchaser_id" />
|
||||
<field name="ins_ref" />
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Included Services">
|
||||
<group>
|
||||
<field name="cost_ids" context="{'vehicle_id': vehicle_id}" nolabel="1" on_change="on_change_indic_cost(cost_ids)">
|
||||
<tree version="7.0" editable="bottom">
|
||||
<field name="cost_subtype" string="Service" domain="[('category','=','service')]"/>
|
||||
<field name="amount" sum="Price" string="Indicative Cost" />
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</group>
|
||||
<div class="oe_right"><group><field name="sum_cost" string="Indicative Costs Total"/></group></div>
|
||||
</page>
|
||||
<page string="Generated Costs">
|
||||
<group>
|
||||
<field name="generated_cost_ids" context="{'vehicle_id': vehicle_id}" nolabel="1" sum="amount">
|
||||
<tree version="7.0" editable="bottom" >
|
||||
<field name="date" />
|
||||
<field name="amount" sum="amount"/>
|
||||
</tree>
|
||||
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<group string="Terms and Conditions">
|
||||
<field name="notes" nolabel="1" placeholder="Write here all other information relative to this contract" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
|
||||
id="act_renew_contract"
|
||||
name="Renew Contract"
|
||||
res_model="fleet.vehicle.log.contract"
|
||||
src_model="fleet.vehicle.log.contract"
|
||||
view_mode="form"
|
||||
view_type="form"
|
||||
/>
|
||||
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_contract_tree'>
|
||||
<field name="name">fleet.vehicle.log.contract.tree</field>
|
||||
<field name="model">fleet.vehicle.log.contract</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Contract logs" version="7.0" colors="orange:days_left>0 and days_left<15;red:days_left==0;grey:state=='closed'">
|
||||
<field name="start_date" />
|
||||
<field name="expiration_date" />
|
||||
<field name="days_left" invisible="1"/>
|
||||
<field name="vehicle_id" />
|
||||
<field name="cost_subtype"/>
|
||||
<field name="insurer_id" />
|
||||
<field name="amount" string="Activation Cost"/>
|
||||
<field name="cost_generated"/>
|
||||
<field name="cost_frequency"/>
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_log_contract_graph">
|
||||
<field name="name">fleet.vehicle.log.contract.graph</field>
|
||||
<field name="model">fleet.vehicle.log.contract</field>
|
||||
<!--<field name="type">graph</field>-->
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Contract Costs Per Month">
|
||||
<field name="date" />
|
||||
<field name="cost_amount" operator="+"/>
|
||||
<field name="vehicle_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_log_contract_act'>
|
||||
<field name="name">Vehicles Contracts</field>
|
||||
<field name="res_model">fleet.vehicle.log.contract</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new contract.
|
||||
</p><p>
|
||||
Manage all your contracts (leasing, insurances, etc.) with
|
||||
their related services, costs. OpenERP will automatically warn
|
||||
you when some contracts have to be renewed.
|
||||
</p><p>
|
||||
Each contract (e.g.: leasing) may include several services
|
||||
(reparation, insurances, periodic maintenance).
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_log_contract_act" parent="fleet_vehicles" id="fleet_vehicle_log_contract_menu" />
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_odometer_form'>
|
||||
<field name="name">fleet.vehicle.odometer.form</field>
|
||||
<field name="model">fleet.vehicle.odometer</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Odometer Logs" version="7.0">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
|
||||
<div>
|
||||
<field name="value" class="oe_inline"/>
|
||||
<field name="unit" class="oe_inline"/>
|
||||
</div>
|
||||
<field name="date" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_odometer_tree'>
|
||||
<field name="name">fleet.vehicle.odometer.tree</field>
|
||||
<field name="model">fleet.vehicle.odometer</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Odometer Logs" version="7.0" editable="top">
|
||||
<field name="date" />
|
||||
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
|
||||
<field name="value" />
|
||||
<field name="unit" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!--
|
||||
<record model='ir.ui.view' id='fleet_vehicle_odometer_search'>
|
||||
<field name="name">fleet.vehicle.odometer.search</field>
|
||||
<field name="model">fleet.vehicle.odometer</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Vehicles odometers" >
|
||||
<field name="vehicle_id" />
|
||||
<field name="value"/>
|
||||
<field name="unit"/>
|
||||
<field name="date"/>
|
||||
<filter name="groupby_vehicle" context="{'group_by' : 'vehicle_id'}" string="Vehicle"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_odometer_graph">
|
||||
<field name="name">fleet.vehicle.odometer.graph</field>
|
||||
<field name="model">fleet.vehicle.odometer</field>
|
||||
<!--<field name="type">graph</field>-->
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Odometer Values Per Month">
|
||||
<field name="date" />
|
||||
<field name="value" operator="+"/>
|
||||
<field name="vehicle_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_odometer_act'>
|
||||
<field name="name">Vehicles Odometer</field>
|
||||
<field name="res_model">fleet.vehicle.odometer</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{"search_default_groupby_vehicle" : True}</field>
|
||||
<field name="help" type="html">
|
||||
<p>
|
||||
Here you can add various odometer entries for all vehicles.
|
||||
You can also show odometer value for a particular vehicle using
|
||||
the search field.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_odometer_act" parent="fleet_vehicles" id="fleet_vehicle_odometer_menu" />
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_fuel_form'>
|
||||
<field name="name">fleet.vehicle.log.fuel.form</field>
|
||||
<field name="model">fleet.vehicle.log.fuel</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fuel Logs" version="7.0">
|
||||
<sheet>
|
||||
<group col="2">
|
||||
<group string="Vehicle Details">
|
||||
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
|
||||
</group>
|
||||
<group string="Refueling Details">
|
||||
<field name="liter" on_change="on_change_liter(liter,price_per_liter,amount)"/>
|
||||
<field name="price_per_liter" on_change="on_change_price_per_liter(liter,price_per_liter,amount)" />
|
||||
<field name="amount" on_change="on_change_amount(liter,price_per_liter,amount)"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group string="Odometer Details">
|
||||
<label for="odometer"/>
|
||||
<div>
|
||||
<field name="odometer" class="oe_inline"/>
|
||||
<field name="odometer_unit" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
<group string="Additional Details">
|
||||
<field name="date" />
|
||||
<field name="purchaser_id" />
|
||||
<field name="inv_ref" />
|
||||
<field name="vendor_id" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="Notes">
|
||||
<field nolabel="1" name="notes" placeholder="Write here any other information"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_fuel_tree'>
|
||||
<field name="name">fleet.vehicle.log.fuel.tree</field>
|
||||
<field name="model">fleet.vehicle.log.fuel</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Fuel Logs">
|
||||
<field name="date" />
|
||||
<field name="vehicle_id" />
|
||||
<field name="odometer" invisible="1"/>
|
||||
<field name="odometer_unit" invisible="1"/>
|
||||
<field name="purchaser_id" />
|
||||
<field name="inv_ref" invisible="1"/>
|
||||
<field name="vendor_id" invisible="1"/>
|
||||
<field name="liter" />
|
||||
<field name="price_per_liter" invisible="1"/>
|
||||
<field name="amount" sum="Price"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_log_fuel_graph">
|
||||
<field name="name">fleet.vehicle.log.fuel.graph</field>
|
||||
<field name="model">fleet.vehicle.log.fuel</field>
|
||||
<!--<field name="type">graph</field>-->
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Fuel Costs Per Month">
|
||||
<field name="date" />
|
||||
<field name="cost_amount" operator="+"/>
|
||||
<field name="vehicle_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_log_fuel_act'>
|
||||
<field name="name">Vehicles Fuel Logs</field>
|
||||
<field name="res_model">fleet.vehicle.log.fuel</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new fuel log.
|
||||
</p><p>
|
||||
Here you can add refuelling entries for all vehicles. You can
|
||||
also filter logs of a particular vehicle using the search
|
||||
field.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_log_fuel_act" parent="fleet_vehicles" id="fleet_vehicle_log_fuel_menu" />
|
||||
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_services_form'>
|
||||
<field name="name">fleet.vehicle.log.services.form</field>
|
||||
<field name="model">fleet.vehicle.log.services</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Services Logs" version="7.0">
|
||||
<sheet>
|
||||
<group col="2">
|
||||
<group string="Services Details">
|
||||
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
|
||||
<field name="cost_subtype" string="Service Type" domain="['|',('category','=','service'),('category','=','both')]" required="1"/>
|
||||
<field name="amount" string="Price"/>
|
||||
</group>
|
||||
<group string="Odometer Details">
|
||||
<label for="odometer"/>
|
||||
<div>
|
||||
<field name="odometer" class="oe_inline"/>
|
||||
<field name="odometer_unit" class="oe_inline"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group string="Additional Details">
|
||||
<field name="date" />
|
||||
<field name="purchaser_id" />
|
||||
<field name="vendor_id" />
|
||||
<field name="inv_ref" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="Included Services">
|
||||
<field name="cost_ids" nolabel="1">
|
||||
<tree string="Included Services" version="7.0" editable="bottom">
|
||||
<field name="cost_subtype" string="Service" domain="[('category','=','service')]"/>
|
||||
<field name="amount" sum="Price" string="Cost"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group string="Notes">
|
||||
<field nolabel="1" name="notes" placeholder="Write here any other information related to the service completed."/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_log_services_tree'>
|
||||
<field name="name">fleet.vehicle.log.services.tree</field>
|
||||
<field name="model">fleet.vehicle.log.services</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Services Logs">
|
||||
<field name="date" />
|
||||
<field name="vehicle_id" />
|
||||
<field name="cost_subtype"/>
|
||||
<field name="purchaser_id"/>
|
||||
<field name="vendor_id" />
|
||||
<field name="inv_ref" />
|
||||
<field name="notes" />
|
||||
<field name="amount" sum="Total"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_log_services_graph">
|
||||
<field name="name">fleet.vehicle.log.services.graph</field>
|
||||
<field name="model">fleet.vehicle.log.services</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Services Costs Per Month">
|
||||
<field name="date" />
|
||||
<field name="cost_amount" operator="+"/>
|
||||
<field name="vehicle_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_log_services_act'>
|
||||
<field name="name">Vehicles Services Logs</field>
|
||||
<field name="res_model">fleet.vehicle.log.services</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new service entry.
|
||||
</p><p>
|
||||
OpenERP helps you keeping track of all the services done
|
||||
on your vehicle. Services can be of many type: occasional
|
||||
repair, fixed maintenance, etc.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_log_services_act" parent="fleet_vehicles" id="fleet_vehicle_log_services_menu" />
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_service_types_tree'>
|
||||
<field name="name">fleet.service.type.tree</field>
|
||||
<field name="model">fleet.service.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Service types" editable="bottom">
|
||||
<field name="name" />
|
||||
<field name="category"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_service_types_act'>
|
||||
<field name="name">Service Types</field>
|
||||
<field name="res_model">fleet.service.type</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new type of service.
|
||||
</p><p>
|
||||
Each service can used in contracts, as a standalone service or both.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_service_types_act" parent="fleet_configuration" id="fleet_vehicle_service_types_menu" groups="base.group_no_one"/>
|
||||
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_costs_tree'>
|
||||
<field name="name">fleet.vehicle.cost.tree</field>
|
||||
<field name="model">fleet.vehicle.cost</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Vehicles costs" >
|
||||
<field name="date"/>
|
||||
<field name="vehicle_id" />
|
||||
<field name="cost_type"/>
|
||||
<field name="cost_subtype"/>
|
||||
<field name="amount" sum="Total Cost"/>
|
||||
<field name="parent_id" invisible="1" />
|
||||
<field name="year" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_costs_search'>
|
||||
<field name="name">fleet.vehicle.cost.search</field>
|
||||
<field name="model">fleet.vehicle.cost</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Vehicles costs" >
|
||||
<field name="vehicle_id" />
|
||||
<field name="cost_subtype"/>
|
||||
<field name="year"/>
|
||||
<field name="date"/>
|
||||
<field name="parent_id"/>
|
||||
<filter name="parent_false" domain="[('parent_id','=',False)]" string="Effective Costs"/>
|
||||
<filter name="parent_true" domain="[('parent_id','!=',False)]" string="Indicative Costs"/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter name="groupby_year" context="{'group_by' : 'year'}" string="Year"/>
|
||||
<filter name="groupby_date" context="{'group_by' : 'date'}" string="Date"/>
|
||||
<filter name="groupby_cost_type" context="{'group_by' : 'cost_type'}" string="Cost Type"/>
|
||||
<filter name="groupby_cost_subtype" context="{'group_by' : 'cost_subtype'}" string="Cost Subtype"/>
|
||||
<filter name="groupby_vehicle_id" context="{'group_by' : 'vehicle_id'}" string="Vehicle"/>
|
||||
<filter name="groupby_parent_id" context="{'group_by' : 'parent_id'}" string="Parent"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.ui.view' id='fleet_vehicle_costs_form'>
|
||||
<field name="name">fleet.vehicle.cost.form</field>
|
||||
<field name="model">fleet.vehicle.cost</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Vehicle costs" version="7.0">
|
||||
<sheet>
|
||||
<group col="2" string="Cost Details">
|
||||
<group>
|
||||
<field name="vehicle_id" />
|
||||
<field name="cost_subtype"/>
|
||||
<field name="amount"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="fleet_vehicle_costs_graph">
|
||||
<field name="name">fleet.vehicle.cost.graph</field>
|
||||
<field name="model">fleet.vehicle.cost</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Costs Per Month">
|
||||
<field name="date" />
|
||||
<field name="amount"/>
|
||||
<field name="vehicle_id" group="True"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='fleet_vehicle_costs_act'>
|
||||
<field name="name">Vehicle Costs</field>
|
||||
<field name="res_model">fleet.vehicle.cost</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="context">{"search_default_parent_false" : True, "search_default_groupby_vehicle_id" : True,}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new cost.
|
||||
</p><p>
|
||||
OpenERP helps you managing the costs for your different
|
||||
vehicles. Costs are created automatically from services,
|
||||
contracts (fixed or recurring) and fuel logs.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="fleet_vehicle_costs_act" parent="fleet_vehicles" id="fleet_vehicle_costs_menu" />
|
||||
<!--
|
||||
<record model='ir.ui.view' id='fleet_hr_employee_form'>
|
||||
<field name="name">fleet.hr.employee.form</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr.view_employee_form" />
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Vehicle">
|
||||
<group>
|
||||
<field name="vehicle_id" widget="many2many_tags"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="fleet.vehicle.model" id="citroen">
|
||||
<field name="name">Citroen</field>
|
||||
</record>
|
||||
|
||||
<record model="fleet.vehicle" id="stw_vehicle">
|
||||
<field name="name">240BTN</field>
|
||||
<field name="model_id" ref="citroen" />
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,13 @@
|
||||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
|
||||
fleet_vehicle_model_access_right,fleet_vehicle_model_access_right,model_fleet_vehicle_model,,1,1,1,1
|
||||
fleet_vehicle_tag_access_right,fleet_vehicle_tag_access_right,model_fleet_vehicle_tag,,1,1,1,1
|
||||
fleet_vehicle_state_access_right,fleet_vehicle_state_access_right,model_fleet_vehicle_state,,1,1,1,1
|
||||
fleet_vehicle_odometer_access_right,fleet_vehicle_odometer_access_right,model_fleet_vehicle_odometer,,1,1,1,1
|
||||
fleet_vehicle_model_brand_access_right,fleet_vehicle_model_brand_access_right,model_fleet_vehicle_model_brand,,1,1,1,1
|
||||
fleet_vehicle_access_right,fleet_vehicle_access_right,model_fleet_vehicle,,1,1,1,1
|
||||
fleet_vehicle_log_fuel_access_right,fleet_vehicle_log_fuel_access_right,model_fleet_vehicle_log_fuel,,1,1,1,1
|
||||
fleet_vehicle_log_services_access_right,fleet_vehicle_log_services_access_right,model_fleet_vehicle_log_services,,1,1,1,1
|
||||
fleet_vehicle_log_contract_access_right,fleet_vehicle_log_contract_access_right,model_fleet_vehicle_log_contract,,1,1,1,1
|
||||
fleet_service_type_access_right,fleet_service_type_access_right,model_fleet_service_type,,1,1,1,1
|
||||
access_fleet_vehicle_cost,access_fleet_vehicle_cost,model_fleet_vehicle_cost,,1,1,1,1
|
||||
access_fleet_contract_state,access_fleet_contract_state,model_fleet_contract_state,,1,1,1,1
|
||||
|
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -14,8 +14,8 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-08 04:47+0000\n"
|
||||
"X-Generator: Launchpad (build 16232)\n"
|
||||
"X-Launchpad-Export-Date: 2012-11-09 04:39+0000\n"
|
||||
"X-Generator: Launchpad (build 16250)\n"
|
||||
|
||||
#. module: google_base_account
|
||||
#: field:res.users,gmail_user:0
|
||||
|
||||
@@ -158,6 +158,8 @@ class hr_employee(osv.osv):
|
||||
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
|
||||
|
||||
_columns = {
|
||||
#we need a related field in order to be able to sort the employee by name
|
||||
'name_related': fields.related('resource_id', 'name', type='char', string='Name', readonly=True, store=True),
|
||||
'country_id': fields.many2one('res.country', 'Nationality'),
|
||||
'birthday': fields.date("Date of Birth"),
|
||||
'ssnid': fields.char('SSN No', size=32, help='Social Security Number'),
|
||||
@@ -207,6 +209,8 @@ class hr_employee(osv.osv):
|
||||
'last_login': fields.related('user_id', 'date', type='datetime', string='Latest Connection', readonly=1),
|
||||
}
|
||||
|
||||
_order='name_related'
|
||||
|
||||
def create(self, cr, uid, data, context=None):
|
||||
employee_id = super(hr_employee, self).create(cr, uid, data, context=context)
|
||||
try:
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="mail.group_all_employees"/>
|
||||
<field name="type">notification</field>
|
||||
<field name="subtype_id" ref="mail.mt_comment"/>
|
||||
<field name="subject">Employee Directory application installed!</field>
|
||||
<field name="body">Manage your human resources with OpenERP: employees and their hierarchy, HR departments and job positions.
|
||||
|
||||
More HR features are available via extra applications: Recruitment Process (manage job positions and recruitment), Timesheet Validation (record timesheets and attendance),
|
||||
Leave Management (keep track of employee leaves), Expense Management (manage employee expenses), Employee Appraisals (organize employee surveys, where employees evaluate their subordinates or their manager).</field>
|
||||
<field name="body"><![CDATA[<p>Manage your human resources with OpenERP: employees and their hierarchy, HR departments and job positions.</p>
|
||||
<p>More HR features are available via extra applications: Recruitment Process (manage job positions and recruitment), Timesheet Validation (record timesheets and attendance),
|
||||
Leave Management (keep track of employee leaves), Expense Management (manage employee expenses), Employee Appraisals (organize employee surveys, where employees evaluate their subordinates or their manager).</p>]]></field>
|
||||
</record>
|
||||
|
||||
<record id="employee" model="hr.employee">
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
</record>
|
||||
|
||||
<record id="open_view_categ_form" model="ir.actions.act_window">
|
||||
<field name="name">Categories of Employee</field>
|
||||
<field name="name">Categories of Employees</field>
|
||||
<field name="res_model">hr.employee.category</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
@@ -342,8 +342,8 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="no_of_employee" groups="base.group_user"/>
|
||||
<field name="expected_employees" groups="base.group_user"/>
|
||||
<field name="no_of_recruitment" on_change="on_change_expected_employee(no_of_recruitment,no_of_employee)"/>
|
||||
<field name="expected_employees" groups="base.group_user"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user