[MERGE] merge with lp:~openerp-dev/openobject-addons/trunk-dev-addons1
bzr revid: sbh@tinyerp.com-20100430050644-tz1au6vt753jhnl5
This commit is contained in:
commit
07da611bc2
|
@ -887,7 +887,7 @@ class account_move(osv.osv):
|
|||
|
||||
cr.execute('update account_move set state=%s where id =ANY(%s) ',('posted',ids,))
|
||||
else:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !'))
|
||||
raise osv.except_osv(_('Integrity Error !'), _('You can not validate a non-balanced entry !\nMake sure you have configured Payment Term properly !\nIt should contain atleast one Payment Term Line with type "Balance" !'))
|
||||
return True
|
||||
|
||||
def button_validate(self, cursor, user, ids, context=None):
|
||||
|
|
|
@ -29,69 +29,15 @@ import tools
|
|||
from tools import config
|
||||
|
||||
class account_analytic_line(osv.osv):
|
||||
_name = 'account.analytic.line'
|
||||
_inherit = 'account.analytic.line'
|
||||
_description = 'Analytic lines'
|
||||
|
||||
def _amount_currency(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
cmp_cur_id=rec.company_id.currency_id.id
|
||||
aa_cur_id=rec.account_id.currency_id.id
|
||||
# Always provide the amount in currency
|
||||
if cmp_cur_id != aa_cur_id:
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
ctx = {}
|
||||
if rec.date and rec.amount:
|
||||
ctx['date'] = rec.date
|
||||
result[rec.id] = cur_obj.compute(cr, uid, rec.company_id.currency_id.id,
|
||||
rec.account_id.currency_id.id, rec.amount,
|
||||
context=ctx)
|
||||
else:
|
||||
result[rec.id]=rec.amount
|
||||
return result
|
||||
|
||||
def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
# Always provide second currency
|
||||
result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code)
|
||||
return result
|
||||
|
||||
def _get_account_line(self, cr, uid, ids, context={}):
|
||||
aac_ids = {}
|
||||
for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids):
|
||||
aac_ids[acc.id] = True
|
||||
aal_ids = []
|
||||
if aac_ids:
|
||||
aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('account_id','in',aac_ids.keys())], context=context)
|
||||
return aal_ids
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Description', size=256, required=True),
|
||||
'date' : fields.date('Date', required=True),
|
||||
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'),
|
||||
'unit_amount' : fields.float('Quantity', help='Specifies the amount of quantity to count.'),
|
||||
'product_uom_id' : fields.many2one('product.uom', 'UoM'),
|
||||
'product_id' : fields.many2one('product.product', 'Product'),
|
||||
'account_id' : fields.many2one('account.analytic.account', 'Analytic Account', required=True, ondelete='cascade', select=True),
|
||||
'general_account_id' : fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'),
|
||||
'move_id' : fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
|
||||
'journal_id' : fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),
|
||||
'code' : fields.char('Code', size=8),
|
||||
'user_id' : fields.many2one('res.users', 'User',),
|
||||
'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency',
|
||||
store={
|
||||
'account.analytic.account': (_get_account_line, ['company_id'], 50),
|
||||
'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10),
|
||||
},
|
||||
help="The related account currency if not equal to the company one."),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
'amount_currency': fields.function(_amount_currency, method=True, digits_compute= dp.get_precision('Account'), string='Amount currency',
|
||||
store={
|
||||
'account.analytic.account': (_get_account_line, ['company_id'], 50),
|
||||
'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10),
|
||||
},
|
||||
help="The amount expressed in the related account currency if not equal to the company one."),
|
||||
'ref': fields.char('Ref.', size=64),
|
||||
}
|
||||
_defaults = {
|
||||
|
|
|
@ -7,27 +7,27 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2009-09-08 16:37+0000\n"
|
||||
"Last-Translator: paola <pcaffaro@tiscali.it>\n"
|
||||
"PO-Revision-Date: 2010-04-29 11:06+0000\n"
|
||||
"Last-Translator: Lorenzo Lucio Ancora <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: 2010-04-17 04:11+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-30 03:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account4_ids:0
|
||||
msgid "Account4 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account4"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: constraint:ir.model:0
|
||||
msgid ""
|
||||
"The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
"Il nome dell'oggetto deve iniziare per x_ e non deve contenere caratteri "
|
||||
"speciali!"
|
||||
"Il nome dell'oggetto deve iniziare con x_ e non può contenere caratteri "
|
||||
"speciali !"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: model:ir.actions.report.xml,name:account_analytic_plans.account_analytic_account_crossovered_analytic
|
||||
|
@ -38,7 +38,7 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account5_ids:0
|
||||
msgid "Account5 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account5"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_field:wizard.crossovered.analytic,init,date2:0
|
||||
|
@ -77,7 +77,7 @@ msgstr "Stampa"
|
|||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "To Date"
|
||||
msgstr ""
|
||||
msgstr "Alla data"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance.line,plan_id:0
|
||||
|
@ -102,22 +102,22 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,code:0
|
||||
msgid "Distribution Code"
|
||||
msgstr ""
|
||||
msgstr "Codice di distribuzione"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
msgstr "Nome del modello non valido nella definizione dell'azione."
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.line,name:0
|
||||
msgid "Plan Name"
|
||||
msgstr ""
|
||||
msgstr "Nome del piano"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "Printing date"
|
||||
msgstr ""
|
||||
msgstr "Data di stampa"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
|
@ -127,28 +127,28 @@ msgstr "Percentuale"
|
|||
#. module: account_analytic_plans
|
||||
#: wizard_field:wizard.crossovered.analytic,init,empty_line:0
|
||||
msgid "Dont show empty lines"
|
||||
msgstr ""
|
||||
msgstr "Non mostrare le righe vuote"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_view:wizard.crossovered.analytic,init:0
|
||||
msgid "Select Information"
|
||||
msgstr ""
|
||||
msgstr "Scegli l'informazione"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account3_ids:0
|
||||
msgid "Account3 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account3"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,journal_id:0
|
||||
#: wizard_field:wizard.crossovered.analytic,init,journal_ids:0
|
||||
msgid "Analytic Journal"
|
||||
msgstr ""
|
||||
msgstr "Registro Analitico"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "100.00%"
|
||||
msgstr ""
|
||||
msgstr "Cento per cento"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_field:wizard.crossovered.analytic,init,ref:0
|
||||
|
@ -158,12 +158,12 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "Analytic Account :"
|
||||
msgstr ""
|
||||
msgstr "Account analitico:"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: view:account.analytic.plan.line:0
|
||||
msgid "Analytic Plan Line"
|
||||
msgstr ""
|
||||
msgstr "Linea del piano analitico"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
|
@ -173,12 +173,12 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: model:ir.actions.wizard,name:account_analytic_plans.create_model
|
||||
msgid "Create Model"
|
||||
msgstr ""
|
||||
msgstr "Crea un modello"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan,default_instance_id:0
|
||||
msgid "Default Entries"
|
||||
msgstr ""
|
||||
msgstr "Valori di default"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: view:account.analytic.plan:0
|
||||
|
@ -191,27 +191,27 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.line,min_required:0
|
||||
msgid "Minimum Allowed (%)"
|
||||
msgstr ""
|
||||
msgstr "Minimo consentito (%)"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account1_ids:0
|
||||
msgid "Account1 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account1"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.line,max_required:0
|
||||
msgid "Maximum Allowed (%)"
|
||||
msgstr ""
|
||||
msgstr "Massimo consentito (%)"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_view:create.model,info:0
|
||||
msgid "Distribution Model Saved"
|
||||
msgstr ""
|
||||
msgstr "Modello di distribuzione salvato"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance
|
||||
msgid "Analytic Plan Instance"
|
||||
msgstr ""
|
||||
msgstr "Istanza del piano analitico"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: constraint:ir.ui.view:0
|
||||
|
@ -221,7 +221,7 @@ msgstr "XML non valido per Visualizzazione Architettura!"
|
|||
#. module: account_analytic_plans
|
||||
#: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_instance_model_open
|
||||
msgid "Distribution Models"
|
||||
msgstr ""
|
||||
msgstr "Modelli di distribuzione"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: model:ir.module.module,description:account_analytic_plans.module_meta_information
|
||||
|
@ -267,7 +267,7 @@ msgstr ""
|
|||
#: view:account.analytic.plan.line:0
|
||||
#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_line
|
||||
msgid "Analytic Plan Lines"
|
||||
msgstr ""
|
||||
msgstr "Linee del piano analitico"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
|
@ -277,68 +277,70 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,plan_id:0
|
||||
msgid "Model's Plan"
|
||||
msgstr ""
|
||||
msgstr "Piano dei modelli"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account2_ids:0
|
||||
msgid "Account2 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account2"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
msgstr "Quantità"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: help:account.analytic.plan.line,root_analytic_id:0
|
||||
msgid "Root account of this plan."
|
||||
msgstr ""
|
||||
msgstr "Account radice per questo piano"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account6_ids:0
|
||||
msgid "Account6 Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo di Account6"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
msgstr "Quantità"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance,account_ids:0
|
||||
msgid "Account Id"
|
||||
msgstr ""
|
||||
msgstr "Identificativo dell'Account"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
msgstr "Codice"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_button:create.model,info,end:0
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
msgstr "OK"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.line,root_analytic_id:0
|
||||
msgid "Root Account"
|
||||
msgstr ""
|
||||
msgstr "Account radice"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_view:create.model,info:0
|
||||
msgid ""
|
||||
"This distribution model has been saved. You will be able to reuse it later."
|
||||
msgstr ""
|
||||
"Questo modello di distribuzione è stato salvato. Lo potrai usare di nuovo in "
|
||||
"seguito."
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.line,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
msgstr "Sequenza"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.plan.instance.line,analytic_account_id:0
|
||||
msgid "Analytic Account"
|
||||
msgstr ""
|
||||
msgstr "Account analitico"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: field:account.analytic.default,analytics_id:0
|
||||
|
@ -347,22 +349,22 @@ msgstr ""
|
|||
#: field:account.invoice.line,analytics_id:0
|
||||
#: field:account.move.line,analytics_id:0
|
||||
msgid "Analytic Distribution"
|
||||
msgstr ""
|
||||
msgstr "Distribuzione analitica"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_instance_action
|
||||
msgid "Analytic Distribution's models"
|
||||
msgstr ""
|
||||
msgstr "Modelli della distribuzione analitica"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_button:wizard.crossovered.analytic,init,end:0
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
msgstr "Annulla"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: wizard_field:wizard.crossovered.analytic,init,date1:0
|
||||
msgid "Start Date"
|
||||
msgstr ""
|
||||
msgstr "Data di inizio"
|
||||
|
||||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
|
@ -372,4 +374,4 @@ msgstr ""
|
|||
#. module: account_analytic_plans
|
||||
#: rml:account.analytic.account.crossovered.analytic:0
|
||||
msgid "From Date"
|
||||
msgstr ""
|
||||
msgstr "Dalla data"
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
# Occitan (post 1500) translation for openobject-addons
|
||||
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-04-29 14:21+0000\n"
|
||||
"Last-Translator: Cédric VALMARY (Tot en òc) <cvalmary@yahoo.fr>\n"
|
||||
"Language-Team: Occitan (post 1500) <oc@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: 2010-04-30 03:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr "XML invalid per l'arquitectura de la vista"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: field:account.invoice,price_type:0
|
||||
msgid "Price method"
|
||||
msgstr "Metòde de prètz"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: model:ir.module.module,shortdesc:account_tax_include.module_meta_information
|
||||
msgid "Invoices and prices with taxes included"
|
||||
msgstr "Facturas e prèses amb taxas inclusas"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: selection:account.invoice,price_type:0
|
||||
msgid "Tax included"
|
||||
msgstr "Taxa inclusa"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: selection:account.invoice,price_type:0
|
||||
msgid "Tax excluded"
|
||||
msgstr "Fòra taxa"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: view:account.tax:0
|
||||
msgid "Compute Code for Taxes included prices"
|
||||
msgstr "Còde de calcul pels prèses amb taxas compresas"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: field:account.invoice.line,price_subtotal_incl:0
|
||||
msgid "Subtotal"
|
||||
msgstr "Sostotal"
|
|
@ -26,7 +26,7 @@
|
|||
"author" : "Tiny",
|
||||
"website" : "http://www.openerp.com",
|
||||
"category" : "Generic Modules/Projects & Services",
|
||||
"depends" : ["base"],
|
||||
"depends" : ["base", "decimal_precision"],
|
||||
"description": """Module for defining analytic accounting object.
|
||||
""",
|
||||
"init_xml" : [],
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
import time
|
||||
import operator
|
||||
|
||||
from osv import fields
|
||||
from osv import osv
|
||||
from osv import fields, osv
|
||||
import decimal_precision as dp
|
||||
|
||||
#
|
||||
# Object definition
|
||||
|
@ -282,3 +282,70 @@ class account_analytic_account(osv.osv):
|
|||
|
||||
account_analytic_account()
|
||||
|
||||
|
||||
class account_analytic_line(osv.osv):
|
||||
_name = 'account.analytic.line'
|
||||
_description = 'Analytic lines'
|
||||
def _amount_currency(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
cmp_cur_id=rec.company_id.currency_id.id
|
||||
aa_cur_id=rec.account_id.currency_id.id
|
||||
# Always provide the amount in currency
|
||||
if cmp_cur_id != aa_cur_id:
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
ctx = {}
|
||||
if rec.date and rec.amount:
|
||||
ctx['date'] = rec.date
|
||||
result[rec.id] = cur_obj.compute(cr, uid, rec.company_id.currency_id.id,
|
||||
rec.account_id.currency_id.id, rec.amount,
|
||||
context=ctx)
|
||||
else:
|
||||
result[rec.id]=rec.amount
|
||||
return result
|
||||
|
||||
def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}):
|
||||
result = {}
|
||||
for rec in self.browse(cr, uid, ids, context):
|
||||
# Always provide second currency
|
||||
result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code)
|
||||
return result
|
||||
def _get_account_line(self, cr, uid, ids, context={}):
|
||||
aac_ids = {}
|
||||
for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids):
|
||||
aac_ids[acc.id] = True
|
||||
aal_ids = []
|
||||
if aac_ids:
|
||||
aal_ids = self.pool.get('account.analytic.line').search(cr, uid, [('account_id','in',aac_ids.keys())], context=context)
|
||||
return aal_ids
|
||||
|
||||
_columns = {
|
||||
'name' : fields.char('Description', size=256, required=True),
|
||||
'date' : fields.date('Date', required=True),
|
||||
'amount' : fields.float('Amount', required=True, help='Calculated by multiplying the quantity and the price given in the Product\'s cost price.'),
|
||||
'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),
|
||||
'user_id' : fields.many2one('res.users', 'User',),
|
||||
'company_id': fields.many2one('res.company','Company',required=True),
|
||||
'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency',
|
||||
store={
|
||||
'account.analytic.account': (_get_account_line, ['company_id'], 50),
|
||||
'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10),
|
||||
},
|
||||
help="The related account currency if not equal to the company one."),
|
||||
'amount_currency': fields.function(_amount_currency, method=True, digits_compute= dp.get_precision('Account'), string='Amount currency',
|
||||
store={
|
||||
'account.analytic.account': (_get_account_line, ['company_id'], 50),
|
||||
'account.analytic.line': (lambda self,cr,uid,ids,c={}: ids, ['amount','unit_amount'],10),
|
||||
},
|
||||
help="The amount expressed in the related account currency if not equal to the company one."),
|
||||
|
||||
}
|
||||
_defaults = {
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c),
|
||||
}
|
||||
_order = 'date'
|
||||
account_analytic_line()
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
# Occitan (post 1500) translation for openobject-addons
|
||||
# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-04-29 14:21+0000\n"
|
||||
"Last-Translator: Cédric VALMARY (Tot en òc) <cvalmary@yahoo.fr>\n"
|
||||
"Language-Team: Occitan (post 1500) <oc@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: 2010-04-30 03:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr "XML invalid per l'arquitectura de la vista"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: model:ir.model,name:analytic_user_function.model_analytic_user_funct_grid
|
||||
msgid "Relation table between users and products on a analytic account"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: field:analytic_user_funct_grid,product_id:0
|
||||
msgid "Product"
|
||||
msgstr "Produch"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: field:analytic_user_funct_grid,account_id:0
|
||||
msgid "Analytic Account"
|
||||
msgstr "Compte Analitic"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: view:account.analytic.account:0
|
||||
#: field:account.analytic.account,user_product_ids:0
|
||||
msgid "Users/Products Rel."
|
||||
msgstr "Relacion Utilizaires/Produches"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: field:analytic_user_funct_grid,user_id:0
|
||||
msgid "User"
|
||||
msgstr "Utilizaire"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: constraint:ir.model:0
|
||||
msgid ""
|
||||
"The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs "
|
||||
"especials !"
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: model:ir.module.module,shortdesc:analytic_user_function.module_meta_information
|
||||
msgid "Analytic User Function"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic_user_function
|
||||
#: view:analytic_user_funct_grid:0
|
||||
msgid "User's Product for this Analytic Account"
|
||||
msgstr "Produch de l'Utilizaire per aqueste Compte Analitic"
|
|
@ -516,7 +516,7 @@ class crm_case(osv.osv):
|
|||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Case ids
|
||||
@param cases: a browse record list
|
||||
@param keyword: Case action keyword e.g.: If case is closed "Close" keyword is used
|
||||
@param history: Value True/False, If True it makes entry in case History otherwise in Case Log
|
||||
@param email: Email address if any
|
||||
|
@ -525,6 +525,10 @@ class crm_case(osv.osv):
|
|||
if not context:
|
||||
context = {}
|
||||
|
||||
# The mailgate sends the ids of the cases and not the object list
|
||||
if all(isinstance(case_id, (int, long)) for case_id in cases) and context.get('model'):
|
||||
cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
|
||||
|
||||
model_obj = self.pool.get('ir.model')
|
||||
obj = self.pool.get('crm.case.log')
|
||||
for case in cases:
|
||||
|
|
|
@ -190,10 +190,13 @@
|
|||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
<button colspan="4" string="Send New Email"
|
||||
<button colspan="2" string="Send New Email"
|
||||
name="%(action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'crm.opportunity'}"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
<button colspan="2" string="Forward to Partner"
|
||||
name="%(crm_opportunity_forward_to_partner_act)d"
|
||||
icon="gtk-go-forward" type="action" />
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
|
|
@ -7,13 +7,14 @@ msgstr ""
|
|||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2010-01-05 05:59+0000\n"
|
||||
"PO-Revision-Date: 2010-03-30 21:03+0000\n"
|
||||
"Last-Translator: Luis Gerardo Cruz Garcia <lgcruz@morfosys.com>\n"
|
||||
"PO-Revision-Date: 2010-04-29 10:04+0000\n"
|
||||
"Last-Translator: Jordi Esteve - http://www.zikzakmedia.com "
|
||||
"<jesteve@zikzakmedia.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: 2010-04-17 04:02+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-30 03:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: crm
|
||||
|
@ -79,7 +80,7 @@ msgstr "Botón oprimido"
|
|||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
msgid "Planned costs"
|
||||
msgstr "Costos planeados"
|
||||
msgstr "Costos previstos"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:crm.job.partner_create,init,close:0
|
||||
|
@ -89,7 +90,7 @@ msgstr "Requerimiento de trabajo a finalizar"
|
|||
#. module: crm
|
||||
#: field:crm.case.stage,name:0
|
||||
msgid "Stage Name"
|
||||
msgstr "Nombre de etapa"
|
||||
msgstr "Nombre de fase"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
|
@ -174,7 +175,7 @@ msgstr "Busqueda de oportunidades"
|
|||
#: model:ir.ui.menu,name:crm.menu_crm_case_section_stage_tree
|
||||
#: view:report.crm.case.section.stage:0
|
||||
msgid "Cases by Section and Stage"
|
||||
msgstr "Casos por sección y estados"
|
||||
msgstr "Casos por sección y fase"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:crm.job.meeting_set,init,duration:0
|
||||
|
@ -222,7 +223,7 @@ msgstr ""
|
|||
#: wizard_field:crm.phonecall.opportunity_set,opportunity,partner_id:0
|
||||
#: model:process.node,name:crm.process_node_partner0
|
||||
msgid "Partner"
|
||||
msgstr "Compañero"
|
||||
msgstr "Empresa"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.categ,section_id:0
|
||||
|
@ -256,7 +257,7 @@ msgstr "Llamada de telefono"
|
|||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_report_crm_case_section_stage
|
||||
msgid "Cases by section and stage"
|
||||
msgstr "Casos por secciòn y estado"
|
||||
msgstr "Casos por sección y fase"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.rule,act_mail_to_email:0
|
||||
|
@ -297,7 +298,7 @@ msgstr "Criterios"
|
|||
#: model:ir.actions.act_window,name:crm.crm_case_section_act
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_section_act
|
||||
msgid "Sections"
|
||||
msgstr "Secciónes"
|
||||
msgstr "Secciones"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.menu.config_wizard,opportunity:0
|
||||
|
@ -421,6 +422,8 @@ msgid ""
|
|||
"customer. With each commercial opportunity, you can indicate the canall "
|
||||
"which is this opportunity source."
|
||||
msgstr ""
|
||||
"Los canales representan las diferentes maneras que existen de comunicación "
|
||||
"con el cliente. A cada oportunidad se le puede indicar de que canal provino."
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
|
@ -477,7 +480,7 @@ msgstr "Cliente existente"
|
|||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_meet2
|
||||
msgid "Home"
|
||||
msgstr ""
|
||||
msgstr "Particular"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case,categ_id:0
|
||||
|
@ -578,7 +581,7 @@ msgstr "Crear oportunidad"
|
|||
#: selection:report.crm.case.section.categ2,month:0
|
||||
#: selection:report.crm.case.section.stage,month:0
|
||||
msgid "August"
|
||||
msgstr ""
|
||||
msgstr "Agosto"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
|
@ -611,7 +614,7 @@ msgstr "Gestión de relaciones con clientes & proveedores"
|
|||
#: view:crm.email.add.cc:0
|
||||
#: model:ir.actions.act_window,name:crm.action_view_crm_email_add_cc_wizard
|
||||
msgid "Add CC"
|
||||
msgstr "Agregar CC"
|
||||
msgstr "Añadir CC"
|
||||
|
||||
#. module: crm
|
||||
#: selection:report.crm.case.section.categ.categ2,month:0
|
||||
|
@ -634,7 +637,7 @@ msgstr "Rechazado por la compañía"
|
|||
#. module: crm
|
||||
#: field:crm.case,planned_revenue:0
|
||||
msgid "Planned Revenue"
|
||||
msgstr "Retorno planeado"
|
||||
msgstr "Ingresos previstos"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.section,allow_unlink:0
|
||||
|
@ -904,7 +907,7 @@ msgstr "Buscar llamadas"
|
|||
#: wizard_button:crm.lead.opportunity_set,create_partner,create:0
|
||||
#: wizard_button:crm.phonecall.opportunity_set,create_partner,create:0
|
||||
msgid "Continue"
|
||||
msgstr "Continue"
|
||||
msgstr "Siguiente"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.segmentation,som_interval:0
|
||||
|
@ -959,7 +962,7 @@ msgstr "Establecer grado a"
|
|||
#: code:addons/crm/crm.py:0
|
||||
#, python-format
|
||||
msgid "Email!"
|
||||
msgstr ""
|
||||
msgstr "Correo electrónico!"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_lead6
|
||||
|
@ -969,7 +972,7 @@ msgstr "Radio"
|
|||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_opportunity_assign_wizard
|
||||
msgid "crm.opportunity.assign_wizard"
|
||||
msgstr ""
|
||||
msgstr "crm.opportunity.assign_wizard"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case.rule:0
|
||||
|
@ -990,7 +993,7 @@ msgstr "Buscar en Historial"
|
|||
#: help:crm.case.stage,sequence:0
|
||||
msgid "Gives the sequence order when displaying a list of case stages."
|
||||
msgstr ""
|
||||
"Da el orden de secuencia cuando se muestra un lista de etápas de caso."
|
||||
"Indica el orden de secuencia cuando se muestra un lista de fases de casos."
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.section,name:crm.section_support3
|
||||
|
@ -1024,7 +1027,7 @@ msgstr "Importe de compra"
|
|||
#. module: crm
|
||||
#: view:crm.phonecall:0
|
||||
msgid "Direction"
|
||||
msgstr ""
|
||||
msgstr "Dirección"
|
||||
|
||||
#. module: crm
|
||||
#: help:crm.case,email_cc:0
|
||||
|
@ -1059,7 +1062,7 @@ msgstr "Reglas"
|
|||
#: wizard_view:crm.job.meeting_set,init:0
|
||||
#: wizard_view:crm.phonecall.meeting_set,init:0
|
||||
msgid "Plan Meeting"
|
||||
msgstr ""
|
||||
msgstr "Planear reunión"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:crm.new.send.mail,init,state:0
|
||||
|
@ -1090,7 +1093,7 @@ msgstr "<"
|
|||
#. module: crm
|
||||
#: view:crm.case.rule:0
|
||||
msgid "%(case_description)s = Case description"
|
||||
msgstr ""
|
||||
msgstr "%(case_description)s = Descripción del caso"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.fundraising:0
|
||||
|
@ -1111,7 +1114,7 @@ msgstr "Nombre de regla"
|
|||
#. module: crm
|
||||
#: field:crm.case,planned_cost:0
|
||||
msgid "Planned Costs"
|
||||
msgstr "Costos planeados"
|
||||
msgstr "Costos previstos"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_case_history
|
||||
|
@ -1293,7 +1296,7 @@ msgstr "El prospecto se convierte a partner"
|
|||
#. module: crm
|
||||
#: view:crm.case.rule:0
|
||||
msgid "Regex on Case Name"
|
||||
msgstr ""
|
||||
msgstr "Expresión regular del nombre del caso"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.claim:0
|
||||
|
@ -1303,7 +1306,7 @@ msgstr "Reclamaciones Pendientes"
|
|||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_categ_stage
|
||||
msgid "Cases by Opportunities, Category and Stage"
|
||||
msgstr "Casos por oportunidades, categoría y etapa"
|
||||
msgstr "Casos por oportunidades, categoría y fase"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.category2,name:crm.category_lead4
|
||||
|
@ -1416,8 +1419,8 @@ msgid ""
|
|||
"If the active field is set to true, it will allow you to hide the case "
|
||||
"section without removing it."
|
||||
msgstr ""
|
||||
"Si el campo activo esta en verdadero, te permitira esconder la sección del "
|
||||
"caso sin removerla"
|
||||
"Si el campo activo está marcado, podrá ocultar la sección del caso sin "
|
||||
"eliminarla."
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_fund2
|
||||
|
@ -1435,31 +1438,31 @@ msgstr "Estas seguro que deseas crear una empresa basado en esta llamada?"
|
|||
#: model:ir.actions.act_window,name:crm.crm_case_stage_act
|
||||
#: model:ir.ui.menu,name:crm.menu_crm_case_stage_act
|
||||
msgid "Stages"
|
||||
msgstr "Etapas"
|
||||
msgstr "Fases"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_field:crm.case.opportunity.partner_opportunity,init,planned_revenue:0
|
||||
#: wizard_field:crm.lead.opportunity_set,opportunity,planned_revenue:0
|
||||
#: wizard_field:crm.phonecall.opportunity_set,opportunity,planned_revenue:0
|
||||
msgid "Expected Revenue"
|
||||
msgstr ""
|
||||
msgstr "Ingreso estimado"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.meeting:0
|
||||
msgid "Meeting Date"
|
||||
msgstr ""
|
||||
msgstr "Fecha de reunión"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
#: view:crm.lead:0
|
||||
#: view:crm.phonecall:0
|
||||
msgid "Convert to Partner"
|
||||
msgstr ""
|
||||
msgstr "Convertir a empresa"
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.actions.act_window,name:crm.crm_case_category_act_meetall3
|
||||
msgid "Next Meetings"
|
||||
msgstr ""
|
||||
msgstr "Próximas reuniones"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.segmentation,partner_id:0
|
||||
|
@ -1475,7 +1478,7 @@ msgstr "No puede eliminar este caso. Sería mejor que lo cancelara."
|
|||
#. module: crm
|
||||
#: wizard_button:caldav.crm.subscribe,init,open:0
|
||||
msgid "_Subscribe"
|
||||
msgstr ""
|
||||
msgstr "_Suscribir"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.case.rule,trg_priority_from:0
|
||||
|
@ -1485,22 +1488,22 @@ msgstr "Prioridad mínima"
|
|||
#. module: crm
|
||||
#: model:ir.actions.act_window,name:crm.crm_meeting_generic_wizard_act
|
||||
msgid "Meeting Generic Wizard"
|
||||
msgstr ""
|
||||
msgstr "Asistente genérico de reuniones"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_claim2
|
||||
msgid "Value Claims"
|
||||
msgstr ""
|
||||
msgstr "Valor reclamaciones"
|
||||
|
||||
#. module: crm
|
||||
#: wizard_view:caldav.crm.subscribe,display:0
|
||||
msgid "Message..."
|
||||
msgstr ""
|
||||
msgstr "Mensaje..."
|
||||
|
||||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_phonecall_assign_wizard
|
||||
msgid "crm.phonecall.assign_wizard"
|
||||
msgstr ""
|
||||
msgstr "crm.phonecall.assign_wizard"
|
||||
|
||||
#. module: crm
|
||||
#: view:report.crm.case.section.categ2:0
|
||||
|
@ -2179,7 +2182,7 @@ msgstr ""
|
|||
#: view:crm.job:0
|
||||
#: view:crm.lead:0
|
||||
msgid "Stage: "
|
||||
msgstr ""
|
||||
msgstr "Fase: "
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case.section:0
|
||||
|
@ -2806,7 +2809,7 @@ msgstr ""
|
|||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
msgid "Cases By Stage and Estimates"
|
||||
msgstr ""
|
||||
msgstr "Casos por fases y estimaciones"
|
||||
|
||||
#. module: crm
|
||||
#: code:addons/crm/crm.py:0
|
||||
|
@ -3004,7 +3007,7 @@ msgstr ""
|
|||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_report_crm_case_section_categ_stage
|
||||
msgid "Cases by section, Category and stage"
|
||||
msgstr ""
|
||||
msgstr "Casos por sección, categoría y fase"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.job:0
|
||||
|
@ -3297,7 +3300,7 @@ msgstr "Recordatorios por Email (incluye el contenido del caso)"
|
|||
#. module: crm
|
||||
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_lead_stage
|
||||
msgid "Cases by Leads and Stage"
|
||||
msgstr ""
|
||||
msgstr "Casos por iniciativas y fase"
|
||||
|
||||
#. module: crm
|
||||
#: field:crm.meeting,exdate:0
|
||||
|
@ -3410,7 +3413,7 @@ msgstr ""
|
|||
#. module: crm
|
||||
#: view:crm.opportunity:0
|
||||
msgid "Sales Stage: "
|
||||
msgstr ""
|
||||
msgstr "Fase de ventas: "
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.claim:0
|
||||
|
@ -3692,7 +3695,7 @@ msgstr "Secciones hijas"
|
|||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
msgid "Planned revenue"
|
||||
msgstr "Retorno planeado"
|
||||
msgstr "Ingresos previstos"
|
||||
|
||||
#. module: crm
|
||||
#: model:crm.case.categ,name:crm.categ_fund3
|
||||
|
@ -3731,7 +3734,7 @@ msgstr ""
|
|||
#. module: crm
|
||||
#: model:ir.model,name:crm.model_crm_case_stage
|
||||
msgid "Stage of case"
|
||||
msgstr ""
|
||||
msgstr "Fase del caso"
|
||||
|
||||
#. module: crm
|
||||
#: view:crm.case:0
|
||||
|
|
|
@ -189,7 +189,7 @@ class email_parser(object):
|
|||
|
||||
try:
|
||||
id = self.rpc(self.model, 'create', data)
|
||||
self.rpc(self.model, 'history', [id], 'Receive', True, msg['From'], message['body'])
|
||||
self.rpc(self.model, 'history', [id], 'Receive', True, msg['From'], message['body'], False, False, {'model' : self.model})
|
||||
#self.rpc(self.model, 'case_open', [id])
|
||||
except Exception, e:
|
||||
if getattr(e, 'faultCode', '') and 'AccessError' in e.faultCode:
|
||||
|
@ -284,10 +284,10 @@ class email_parser(object):
|
|||
act = 'case_' + actions['state']
|
||||
|
||||
for k1, k2 in [('cost', 'planned_cost'), ('revenue', 'planned_revenue'), ('probability', 'probability')]:
|
||||
try:
|
||||
data[k2] = float(actions[k1])
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
data[k2] = float(actions[k1])
|
||||
except:
|
||||
pass
|
||||
|
||||
if 'priority' in actions:
|
||||
if actions['priority'] in ('1', '2', '3', '4', '5'):
|
||||
|
|
|
@ -157,4 +157,129 @@ class crm_lead_forward_to_partner(osv.osv_memory):
|
|||
return res
|
||||
|
||||
crm_lead_forward_to_partner()
|
||||
|
||||
class crm_opportunity_forward_to_partner(osv.osv_memory):
|
||||
_name = 'crm.opportunity.forward.to.partner'
|
||||
|
||||
_columns = {
|
||||
'partner_id' : fields.many2one('res.partner', 'Partner'),
|
||||
'address_id' : fields.many2one('res.partner.address', 'Address'),
|
||||
'email_from' : fields.char('From', required=True, size=128),
|
||||
'email_to' : fields.char('To', required=True, size=128),
|
||||
'subject' : fields.char('Subject', required=True, size=128),
|
||||
'message' : fields.text('Message', required=True),
|
||||
}
|
||||
|
||||
def on_change_partner(self, cr, uid, ids, partner_id):
|
||||
return {
|
||||
'domain' : {
|
||||
'address_id' : partner_id and "[('partner_id', '=', partner_id)]" or "[]",
|
||||
}
|
||||
}
|
||||
|
||||
def on_change_address(self, cr, uid, ids, address_id):
|
||||
email = ''
|
||||
if address_id:
|
||||
email = self.pool.get('res.partner.address').browse(cr, uid, address_id).email
|
||||
|
||||
return {
|
||||
'value' : {
|
||||
'email_to' : email,
|
||||
}
|
||||
}
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
return {'type' : 'ir.actions.act_window_close'}
|
||||
|
||||
def action_forward(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Forward the opportunity to a partner
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
res_id = context.get('active_id', False)
|
||||
|
||||
if not res_id:
|
||||
return {}
|
||||
|
||||
this = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
hist_obj = self.pool.get('crm.case.history')
|
||||
smtp_pool = self.pool.get('email.smtpclient')
|
||||
case_pool = self.pool.get('crm.opportunity')
|
||||
case = case_pool.browse(cr, uid, res_id, context=context)
|
||||
|
||||
emails = [this.email_to]
|
||||
body = case_pool.format_body(this.message)
|
||||
email_from = this.email_from or False
|
||||
case_pool._history(cr, uid, [case], _('Forward'), history=True, email=this.email_to, details=body, email_from=email_from)
|
||||
|
||||
flag = False
|
||||
if case.section_id and case.section_id.server_id:
|
||||
flag = smtp_pool.send_email(
|
||||
cr=cr,
|
||||
uid=uid,
|
||||
server_id=case.section_id.server_id.id,
|
||||
emailto=emails,
|
||||
subject=this.subject,
|
||||
body="<pre>%s</pre>" % body,
|
||||
)
|
||||
else:
|
||||
flag = tools.email_send(
|
||||
email_from,
|
||||
emails,
|
||||
this.subject,
|
||||
body,
|
||||
)
|
||||
|
||||
return {}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
This function gets default values
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
active_ids = context.get('active_ids')
|
||||
if not active_ids:
|
||||
return {}
|
||||
|
||||
opportunity_proxy = self.pool.get('crm.opportunity')
|
||||
|
||||
opportunity = opportunity_proxy.browse(cr, uid, active_ids[0], context=context)
|
||||
|
||||
pa = opportunity.partner_address_id
|
||||
message = [
|
||||
"Partner: %s" % (opportunity.partner_id.name_get()[0][1]),
|
||||
"Contact: %s" % (pa.name),
|
||||
"Title: %s" % (pa.title),
|
||||
"Function: %s" % (pa.function and pa.function.name_get()[0][1] or ''),
|
||||
"Street: %s" % (pa.street),
|
||||
"Street2: %s" % (pa.street2),
|
||||
"Zip: %s" % (pa.zip),
|
||||
"City: %s" % (pa.city),
|
||||
"Country: %s" % (pa.country_id and pa.country_id.name_get()[0][1] or ''),
|
||||
"State: %s" % (pa.state_id and pa.state_id.name_get()[0][1] or ''),
|
||||
"Email: %s" % (pa.email),
|
||||
"Phone: %s" % (pa.phone),
|
||||
"Fax: %s" % (pa.fax),
|
||||
"Mobile: %s" % (pa.mobile),
|
||||
]
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
email_from = ''
|
||||
if user.address_id and user.address_id.email:
|
||||
email_from = "%s <%s>" % (user.name, user.address_id.email)
|
||||
|
||||
res = {
|
||||
'email_from' : email_from,
|
||||
'subject' : '[Opportunity-Forward:%06d] %s' % (opportunity.id, opportunity.name),
|
||||
'message' : "\n".join(message + ['---']),
|
||||
}
|
||||
|
||||
return res
|
||||
|
||||
crm_opportunity_forward_to_partner()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -34,5 +34,39 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="crm_opportunity_forward_to_partner_form">
|
||||
<field name="name">crm_opportunity_forward_to_partner</field>
|
||||
<field name="model">crm.opportunity.forward.to.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Forward to Partner">
|
||||
<separator string="User" colspan="4" />
|
||||
<field name="email_from" colspan="4" />
|
||||
|
||||
<separator string="Destination" colspan="4" />
|
||||
<field name="partner_id" on_change="on_change_partner(partner_id)" colspan="4" />
|
||||
<field name="address_id" string="Contact" on_change="on_change_address(address_id)" colspan="4" />
|
||||
<field name="email_to" colspan="4" />
|
||||
|
||||
<separator string="Email" colspan="4" />
|
||||
<field name="subject" colspan="4" />
|
||||
<field name="message" colspan="4" />
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="2">
|
||||
<button name="action_cancel" special="cancel" string="Cancel" icon="gtk-cancel" type="object" />
|
||||
<button name="action_forward" string="Forward" icon="gtk-go-forward" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_opportunity_forward_to_partner_act">
|
||||
<field name="name">Forward to Partner</field>
|
||||
<field name="res_model">crm.opportunity.forward.to.partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue