[Merge] Merge with trunk addons

bzr revid: vir@tinyerp.com-20100602082332-bq3vbck48iyd4thx
This commit is contained in:
Vir (Open ERP) 2010-06-02 13:53:32 +05:30
commit a00a181d98
111 changed files with 2321 additions and 2061 deletions

View File

@ -530,9 +530,8 @@ class account_move_line(osv.osv):
date = datetime.now().strftime('%Y-%m-%d')
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
if part.property_payment_term and part.property_payment_term.line_ids:
payterm = part.property_payment_term.line_ids[0]
res = self.pool.get('account.payment.term').compute(cr, uid, payterm.id, 100, date)
if part.property_payment_term:
res = self.pool.get('account.payment.term').compute(cr, uid, part.property_payment_term.id, 100, date)
if res:
val['date_maturity'] = res[0][0]
if not account_id:
@ -540,10 +539,10 @@ class account_move_line(osv.osv):
id2 = part.property_account_receivable.id
if journal:
jt = self.pool.get('account.journal').browse(cr, uid, journal).type
if jt=='sale':
if jt == 'sale':
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, id2)
elif jt=='purchase':
elif jt == 'purchase':
val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, id1)
if val.get('account_id', False):
d = self.onchange_account_id(cr, uid, ids, val['account_id'])

View File

@ -951,23 +951,8 @@ class account_invoice(osv.osv):
return taxes.values()
def _log_event(self, cr, uid, ids, factor=1.0, name='Open Invoice'):
invs = self.read(cr, uid, ids, ['type','partner_id','amount_untaxed'])
for inv in invs:
part=inv['partner_id'] and inv['partner_id'][0]
pc = pr = 0.0
cr.execute('select sum(quantity*price_unit) from account_invoice_line where invoice_id=%s', (inv['id'],))
total = inv['amount_untaxed']
if inv['type'] in ('in_invoice','in_refund'):
partnertype='supplier'
eventtype = 'purchase'
pc = total*factor
else:
partnertype = 'customer'
eventtype = 'sale'
pr = total*factor
if self.pool.get('res.partner.event.type').check(cr, uid, 'invoice_open'):
self.pool.get('res.partner.event').create(cr, uid, {'name':'Invoice: '+name, 'som':False, 'description':name+' '+str(inv['id']), 'document':name, 'partner_id':part, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'canal_id':False, 'user_id':uid, 'partner_type':partnertype, 'probability':1.0, 'planned_revenue':pr, 'planned_cost':pc, 'type':eventtype})
return len(invs)
#TODO: implement messages system
return True
def name_get(self, cr, uid, ids, context=None):
if not len(ids):

View File

@ -74,13 +74,13 @@
<page string="Accounting" position="inside">
<group col="2" colspan="2">
<separator string="Customer Accounting Properties" colspan="2"/>
<field name="property_account_receivable" />
<field name="property_account_receivable" groups="account.group_account_user" />
<field name="property_account_position" widget="selection"/>
<field name="property_payment_term" widget="selection"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Accounting Properties" colspan="2"/>
<field name="property_account_payable"/>
<field name="property_account_payable" groups="account.group_account_user"/>
</group>
<group col="2" colspan="2">
<separator string="Customer Credit" colspan="2"/>
@ -132,11 +132,13 @@
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Project">
<field name="contract_ids" colspan="4" nolabel="1" />
</page>
</notebook>
<xpath expr="//notebook[last()]" position="after">
<notebook colspan="4">
<page string="Project">
<field name="contract_ids" colspan="4" nolabel="1" />
</page>
</notebook>
</xpath>
</field>
</record>

View File

@ -7,13 +7,13 @@ 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-11-28 23:14+0000\n"
"Last-Translator: Paulino <Unknown>\n"
"PO-Revision-Date: 2010-06-01 10:22+0000\n"
"Last-Translator: cmsa <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-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_analysis
@ -38,12 +38,12 @@ msgstr "Data da última factura"
#: help:account.analytic.account,remaining_ca:0
msgid "Computed using the formula: Max Invoice Price - Invoiced Amount."
msgstr ""
"Processado usando a formula: Preço máximo da factura - Montante facturado"
"Processado usando a fórmula: Preço Máximo da Factura - Montante Facturado"
#. module: account_analytic_analysis
#: help:account.analytic.account,remaining_hours:0
msgid "Computed using the formula: Maximum Quantity - Hours Tot."
msgstr "Processado usando a formula: Quantidade máxima - Horas totais."
msgstr "Processado usando a fórmula: Quantidade Máxima - Horas Totais."
#. module: account_analytic_analysis
#: model:ir.ui.menu,name:account_analytic_analysis.menu_action_account_analytic_all
@ -54,32 +54,32 @@ msgstr "Todas as contas de contabilidade analítica"
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_open
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_to_valid_open
msgid "My Current Accounts"
msgstr "Minhas contas correntes"
msgstr "As minhas contas correntes"
#. module: account_analytic_analysis
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML inválido para a arquitectura de vista"
msgstr "XML inválido para a arquitectura de vista!"
#. module: account_analytic_analysis
#: help:account.analytic.account,last_invoice_date:0
msgid "Date of the last invoice created for this analytic account."
msgstr "Data da última factura criada por esta conta analítica."
msgstr "Data da última factura criada para esta conta analítica."
#. module: account_analytic_analysis
#: field:account.analytic.account,ca_theorical:0
msgid "Theorical Revenue"
msgstr "Rendimento teórico"
msgstr "Rendimento Teórico"
#. module: account_analytic_analysis
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr "Nome de modelo invalido na definição da acção"
msgstr "Nome de modelo inválido na definição da acção."
#. module: account_analytic_analysis
#: help:account.analytic.account,theorical_margin:0
msgid "Computed using the formula: Theorial Revenue - Total Costs"
msgstr "Processado usando a formula: Rendimento teórico - Custo total"
msgstr "Processado usando a fórmula: Rendimento Teórico - Custo Total"
#. module: account_analytic_analysis
#: constraint:ir.model:0
@ -113,7 +113,7 @@ msgstr "Conta analíticas correntes"
#. module: account_analytic_analysis
#: help:account.analytic.account,last_worked_date:0
msgid "Date of the latest work done on this account."
msgstr "Data do ultimo trabalho feito nesta conta"
msgstr "Data do último trabalho feito nesta conta"
#. module: account_analytic_analysis
#: help:account.analytic.account,last_worked_invoiced_date:0
@ -121,8 +121,8 @@ msgid ""
"If invoice from the costs, this is the date of the latest work or cost that "
"have been invoiced."
msgstr ""
"Se facturado dos custos, esta é a data do ultimo trabalho ou custo que foi "
"facturado."
"Se facturado sobre os custos, esta é a data do ultimo trabalho ou custo que "
"foi facturado."
#. module: account_analytic_analysis
#: model:ir.ui.menu,name:account_analytic_analysis.menu_invoicing
@ -137,7 +137,7 @@ msgstr "Data do ultimo custo/trabalho"
#. module: account_analytic_analysis
#: field:account.analytic.account,total_cost:0
msgid "Total Costs"
msgstr "Custo total"
msgstr "Custos totais"
#. module: account_analytic_analysis
#: help:account.analytic.account,hours_quantity:0
@ -145,13 +145,13 @@ msgid ""
"Number of hours you spent on the analytic account (from timesheet). It "
"computes on all journal of type 'general'."
msgstr ""
"Número de horas que você passou no conta analítica (do horário). É "
"Número de horas que você passou no conta analítica (da folha de horas). É "
"processado em todo o jornal do tipo 'general'."
#. module: account_analytic_analysis
#: field:account.analytic.account,remaining_hours:0
msgid "Remaining Hours"
msgstr "Horas restantes"
msgstr "Horas Restantes"
#. module: account_analytic_analysis
#: help:account.analytic.account,ca_theorical:0
@ -161,8 +161,8 @@ msgid ""
"the pricelist."
msgstr ""
"Baseado nos custos você teve no projecto, o que seria o rendimento se todos "
"estes custos forem facturados a preço normal da venda fornecido pela lista "
"de preço."
"estes custos fossem facturados ao preço normal da venda fornecidos pela "
"tabela de preço."
#. module: account_analytic_analysis
#: field:account.analytic.account,user_ids:0
@ -174,24 +174,24 @@ msgstr "Utilizador"
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_pending
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_to_valid_pending
msgid "My Pending Accounts"
msgstr "Minhas contas pendentes"
msgstr "As minhas contas pendentes"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_hr_tree_invoiced_my
#: model:ir.ui.menu,name:account_analytic_analysis.menu_action_hr_tree_invoiced_my
msgid "My Uninvoiced Entries"
msgstr "Minhas entradas não facturadas"
msgstr "As minhas entradas não facturadas"
#. module: account_analytic_analysis
#: help:account.analytic.account,real_margin:0
msgid "Computed using the formula: Invoiced Amount - Total Costs."
msgstr "Processado usando a formula: Montante facturado - Custo total."
msgstr "Processado usando a fórmula: Montante Facturado - Custo Total."
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_analytic_account_managed
msgid "My Accounts"
msgstr "Minhas contas"
msgstr "As minhas contas"
#. module: account_analytic_analysis
#: model:ir.module.module,description:account_analytic_analysis.module_meta_information
@ -200,6 +200,9 @@ msgid ""
"important data for project manager of services companies.\n"
"Add menu to show relevant information for each manager."
msgstr ""
"Modificar a vista da conta analítica para mostrar\n"
"dados importantes para o gestor de projecto das empresas de serviços.\n"
"Adicione menu para mostrar as informações relevantes para cada gerente."
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_qtt_non_invoiced:0
@ -219,43 +222,43 @@ msgstr "Contas da contabilidade analítica"
#. module: account_analytic_analysis
#: model:ir.module.module,shortdesc:account_analytic_analysis.module_meta_information
msgid "report_account_analytic"
msgstr ""
msgstr "report_account_analytic"
#. module: account_analytic_analysis
#: field:account.analytic.account,ca_invoiced:0
msgid "Invoiced Amount"
msgstr "Montante facturado"
msgstr "Montante Facturado"
#. module: account_analytic_analysis
#: model:ir.ui.menu,name:account_analytic_analysis.next_id_71
msgid "Financial Project Management"
msgstr "Gestão do projecto financeiro"
msgstr "Gestão do Projecto Financeiro"
#. module: account_analytic_analysis
#: field:account.analytic.account,last_worked_invoiced_date:0
msgid "Date of Last Invoiced Cost"
msgstr "Data do ultimo custo de facturado"
msgstr "Data do último custo facturado"
#. module: account_analytic_analysis
#: field:account.analytic.account,ca_to_invoice:0
msgid "Uninvoiced Amount"
msgstr "Montante facturado"
msgstr "Montante Facturado"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_all_pending
#: model:ir.ui.menu,name:account_analytic_analysis.menu_action_account_analytic_all_pending
msgid "Pending Analytic Accounts"
msgstr "Contas da contabilidade analítica pendentes"
msgstr "Contabilidade analítica contas pendentes"
#. module: account_analytic_analysis
#: field:account.analytic.account,hours_qtt_invoiced:0
msgid "Invoiced Hours"
msgstr "Horas facturadas"
msgstr "Horas Facturadas"
#. module: account_analytic_analysis
#: field:account.analytic.account,real_margin:0
msgid "Real Margin"
msgstr "Margem real"
msgstr "Margem Real"
#. module: account_analytic_analysis
#: help:account.analytic.account,ca_invoiced:0
@ -265,12 +268,12 @@ msgstr "Montante da facturação total do cliente para esta conta"
#. module: account_analytic_analysis
#: model:ir.model,name:account_analytic_analysis.model_account_analytic_analysis_summary_month
msgid "Hours summary by month"
msgstr "Sumário de horas por mês"
msgstr "Resumo de horas por mês"
#. module: account_analytic_analysis
#: help:account.analytic.account,real_margin_rate:0
msgid "Computes using the formula: (Real Margin / Total Costs) * 100."
msgstr "Processado usando a formula: (Margem real / Custos total) * 100."
msgstr "Processado usando a fórmula: (Margem Real / Custos Total) * 100."
#. module: account_analytic_analysis
#: help:account.analytic.account,hours_qtt_non_invoiced:0
@ -279,17 +282,17 @@ msgid ""
"invoice based on analytic account."
msgstr ""
"Número de horas (do diário de tipo 'geral') que pode ser facturado se você "
"factura baseado na conta analítica."
"factura baseado em conta analítica."
#. module: account_analytic_analysis
#: view:account.analytic.account:0
msgid "Analytic accounts"
msgstr "Conta da Contabilidade analítica"
msgstr "Contas da Contabilidade Analítica"
#. module: account_analytic_analysis
#: field:account.analytic.account,remaining_ca:0
msgid "Remaining Revenue"
msgstr "Lucro restante"
msgstr "Receita Restante"
#. module: account_analytic_analysis
#: help:account.analytic.account,ca_to_invoice:0
@ -297,18 +300,18 @@ msgid ""
"If invoice from analytic account, the remaining amount you can invoice to "
"the customer based on the total costs."
msgstr ""
"Se facturado da conta analítica, a quantidade restante que você pode "
"Se facturado por conta analítica, a quantidade restante que você pode "
"facturar ao cliente baseado nos custos totais."
#. module: account_analytic_analysis
#: help:account.analytic.account,revenue_per_hour:0
msgid "Computed using the formula: Invoiced Amount / Hours Tot."
msgstr "Processado usando a formula: Montante facturado / Horas totais."
msgstr "Processado usando a fórmula: Montante Facturado / Horas Totais."
#. module: account_analytic_analysis
#: field:account.analytic.account,revenue_per_hour:0
msgid "Revenue per Hours (real)"
msgstr "Lucro por hora (real)"
msgstr "Receitas por hora (real)"
#. module: account_analytic_analysis
#: field:account_analytic_analysis.summary.month,unit_amount:0
@ -332,7 +335,7 @@ msgstr "Conta da Contabilidade Analítica"
#: model:ir.actions.act_window,name:account_analytic_analysis.action_account_analytic_managed_overpassed
#: model:ir.ui.menu,name:account_analytic_analysis.menu_action_account_analytic_managed_overpassed
msgid "Overpassed Accounts"
msgstr "Contas ultrapassadas"
msgstr "Contas Excedidas"
#. module: account_analytic_analysis
#: model:ir.actions.act_window,name:account_analytic_analysis.action_hr_tree_invoiced_all
@ -347,4 +350,4 @@ msgid ""
"indirect costs, like time spent on timesheets."
msgstr ""
"Total de custos para esta conta. Inclui custos reais (das facturas) e custos "
"indirectos, como o tempo passado em folha de presença."
"indirectos, como o tempo passado em folha de horas."

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-28 23:17+0000\n"
"Last-Translator: Paulino <Unknown>\n"
"PO-Revision-Date: 2010-06-01 10:24+0000\n"
"Last-Translator: cmsa <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-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_plans
@ -26,8 +26,7 @@ msgstr "Identificação da conta4"
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
"O nome do Objecto deve começar com x_ e não pode conter nenhum caractere "
"especial !"
"O nome do objecto deve começar com x_ e não pode conter um carácter especial!"
#. module: account_analytic_plans
#: model:ir.actions.report.xml,name:account_analytic_plans.account_analytic_account_crossovered_analytic

View File

@ -7,19 +7,19 @@ 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-11-28 23:25+0000\n"
"Last-Translator: Paulino <Unknown>\n"
"PO-Revision-Date: 2010-06-01 09:55+0000\n"
"Last-Translator: cmsa <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:12+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_invoice_layout
#: selection:account.invoice.line,state:0
msgid "Sub Total"
msgstr "Sub Total"
msgstr "Sub-total"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -48,7 +48,7 @@ msgstr "Título"
#. module: account_invoice_layout
#: model:ir.actions.wizard,name:account_invoice_layout.wizard_notify_message
msgid "Invoices with Layout and Message"
msgstr "Facturas com layout e mensagem"
msgstr "Facturas com Layout e Mensagem"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -84,7 +84,7 @@ msgstr "Preço Unitário"
#. module: account_invoice_layout
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nome do modelo inválido na definição da acção."
#. module: account_invoice_layout
#: model:ir.model,name:account_invoice_layout.model_notify_message
@ -119,7 +119,7 @@ msgstr "Referençia do cliente:"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid ")"
msgstr ""
msgstr ")"
#. module: account_invoice_layout
#: field:account.invoice.line,state:0
@ -134,7 +134,7 @@ msgstr "Preço"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "/ ("
msgstr ""
msgstr "/("
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -149,7 +149,7 @@ msgstr "Conta de Origem"
#. module: account_invoice_layout
#: model:ir.actions.act_window,name:account_invoice_layout.notify_mesage_tree_form
msgid "Write Messages"
msgstr ""
msgstr "Escrever mensagens"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -189,7 +189,7 @@ msgstr "Quebra de Página"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Document:"
msgstr ""
msgstr "Documento:"
#. module: account_invoice_layout
#: wizard_view:wizard.notify_message,init:0
@ -214,7 +214,7 @@ msgstr "Facturas com disposição"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Description / Taxes"
msgstr ""
msgstr "Descrição / Impostos"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -224,7 +224,7 @@ msgstr "Montante"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Description/Taxes"
msgstr ""
msgstr "Descrição/Impostos"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -264,7 +264,7 @@ msgstr "Factura do fornecedor"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Note :"
msgstr ""
msgstr "Nota:"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
@ -274,12 +274,12 @@ msgstr "Taxa"
#. module: account_invoice_layout
#: model:ir.module.module,shortdesc:account_invoice_layout.module_meta_information
msgid "account_invoice_layout"
msgstr ""
msgstr "account_invoice_layout"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0
msgid "Total (Excl. taxes):"
msgstr ""
msgstr "Total (Antes de Impostos):"
#. module: account_invoice_layout
#: rml:account.invoice.layout:0

View File

@ -7,13 +7,13 @@ 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-11-28 23:58+0000\n"
"Last-Translator: Paulino <Unknown>\n"
"PO-Revision-Date: 2010-06-01 09:52+0000\n"
"Last-Translator: cmsa <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:16+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_reporting
@ -46,13 +46,13 @@ msgstr "Nota"
#. module: account_reporting
#: field:account.report.bs,report_type:0
msgid "Report Type"
msgstr "Tipo de relatório"
msgstr "Tipo de Relatório"
#. module: account_reporting
#: model:ir.ui.menu,name:account_reporting.action_account_report_bs_form
#: model:ir.ui.menu,name:account_reporting.menu_finan_config_BSheet
msgid "Balance Sheet Report"
msgstr "Relatório do balancete"
msgstr "Relatório Balancete"
#. module: account_reporting
#: constraint:ir.actions.act_window:0
@ -62,7 +62,7 @@ msgstr "Nome de modelo inválido na definição da acção"
#. module: account_reporting
#: selection:account.report.bs,font_style:0
msgid "Courier"
msgstr "Correio"
msgstr "Courier"
#. module: account_reporting
#: selection:account.report.bs,font_style:0
@ -167,7 +167,7 @@ msgstr "Cores rml"
#. module: account_reporting
#: model:ir.module.module,shortdesc:account_reporting.module_meta_information
msgid "Reporting of Balancesheet for accounting"
msgstr ""
msgstr "Relatório do balancete para a contabilidade."
#. module: account_reporting
#: field:account.report.bs,code:0

View File

@ -56,15 +56,15 @@
<field name="server_action_id"/>
<field name="filter_id"/>
</page>
<page string="E-Mail Actions">
<page string="Email Actions">
<!-- <group col="4" colspan="2">-->
<separator colspan="4" string="Template of Email to Send"/>
<separator colspan="4" string="Email Information"/>
<field name="act_mail_to_watchers"/>
<field name="act_mail_to_user"/>
<field colspan="4" name="act_mail_to_email"/>
<!-- </group>-->
<!-- <group col="4" colspan="2">-->
<separator colspan="4" string="E-Mail Reminders (includes the content of the object)"/>
<separator colspan="4" string="Email Reminders"/>
<field name="act_remind_partner"/>
<field name="act_remind_attach"/>
<field name="act_remind_user"/>
@ -73,7 +73,7 @@
</group>
<field colspan="4" name="act_email_cc"/>
<!-- </group>-->
<separator colspan="4" string="Mail Body"/>
<separator colspan="4" string="Email Body"/>
<field colspan="4" name="act_mail_body" height="250"
nolabel="1" attrs="{'required':[('act_remind_user','=',True)]}" />
<separator colspan="4" string="Special Keywords to Be Used in The Body"/>
@ -82,9 +82,9 @@
<label align="0.0" string="%%(object_description)s = Object description" colspan="2"/>
<label align="0.0" string="%%(object_date)s = Creation date" colspan="2"/>
<label align="0.0" string="%%(partner)s = Partner name" colspan="2"/>
<label align="0.0" string="%%(partner_email)s = Partner email" colspan="2"/>
<label align="0.0" string="%%(partner_email)s = Partner Email" colspan="2"/>
<label align="0.0" string="%%(object_user)s = Responsible name" colspan="2"/>
<label align="0.0" string="%%(object_user_email)s = Responsible email" colspan="2"/>
<label align="0.0" string="%%(object_user_email)s = Responsible Email" colspan="2"/>
<label align="0.0" string="%%(object_user_phone)s = Responsible phone" colspan="2"/>
</page>
</notebook>

View File

@ -410,7 +410,10 @@ property or property parameter."),
event.add('location').value = event_obj.location
if event_obj.rrule:
event.add('rrule').value = event_obj.rrule
if event_obj.user_id:
event_org = event.add('organizer')
event_org.params['CN'] = [event_obj.user_id.name]
event_org.value = 'MAILTO:' + (event_obj.user_id.user_email or event_obj.user_id.name)
if event_obj.alarm_id:
# computes alarm data
valarm = event.add('valarm')
@ -440,7 +443,7 @@ property or property parameter."),
attendee_add.params['CUTYPE'] = [str(attendee.cutype)]
attendee_add.params['ROLE'] = [str(attendee.role)]
attendee_add.params['RSVP'] = [str(attendee.rsvp)]
attendee_add.value = 'MAILTO:' + attendee.email
attendee_add.value = 'MAILTO:' + (attendee.email or '')
res = cal.serialize()
return res
@ -480,8 +483,8 @@ property or property parameter."),
'company': company
}
body = html_invitation % body_vals
attach = self.get_ics_file(cr, uid, res_obj, context=context)
if mail_to and email_from:
attach = self.get_ics_file(cr, uid, res_obj, context=context)
tools.email_send(
email_from,
mail_to,

View File

@ -7,13 +7,13 @@ 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 13:29+0000\n"
"Last-Translator: Madalena_prime <madalena.barreto@prime.cv>\n"
"PO-Revision-Date: 2010-06-01 10:02+0000\n"
"Last-Translator: cmsa <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:15+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board
@ -26,7 +26,7 @@ msgstr ""
#. module: board
#: model:ir.model,name:board.model_board_board
msgid "board.board"
msgstr ""
msgstr "board.board"
#. module: board
#: field:board.note,user_id:0
@ -36,7 +36,7 @@ msgstr "Autor"
#. module: board
#: model:ir.module.module,shortdesc:board.module_meta_information
msgid "Dashboard main module"
msgstr ""
msgstr "Módulo Principal do Painel"
#. module: board
#: view:board.note:0
@ -52,7 +52,7 @@ msgstr "Largura"
#. module: board
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nome de modelo inválido na definição da aclção."
#. module: board
#: field:board.board.line,name:0
@ -84,7 +84,7 @@ msgstr "Vista de acções"
#. module: board
#: model:ir.model,name:board.model_board_note
msgid "board.note"
msgstr ""
msgstr "board.note"
#. module: board
#: field:board.note,date:0
@ -124,7 +124,7 @@ msgstr "Notas"
#. module: board
#: model:ir.model,name:board.model_board_note_type
msgid "board.note.type"
msgstr ""
msgstr "board.note.type"
#. module: board
#: view:board.board:0
@ -136,7 +136,7 @@ msgstr "Painel"
#. module: board
#: model:ir.module.module,description:board.module_meta_information
msgid "Base module for all dashboards."
msgstr ""
msgstr "Módulo base para todos os painéis."
#. module: board
#: field:board.board.line,position:0
@ -212,7 +212,7 @@ msgstr "Vista de painel"
#. module: board
#: model:ir.model,name:board.model_board_board_line
msgid "board.board.line"
msgstr ""
msgstr "board.board.line"
#. module: board
#: field:board.note,name:0

View File

@ -10,3 +10,4 @@
"access_calendar_event_export","calendar.event.export","model_calendar_event_export","base.group_user",1,1,1,1
"access_calendar_event_import","calendar.event.import","model_calendar_event_import","base.group_user",1,1,1,1
"access_calendar_event_subscribe","calendar.event.subscribe","model_calendar_event_subscribe","base.group_user",1,1,1,1
"access_basic_calendar","basic.calendar","model_basic_calendar","base.group_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
10 access_calendar_event_export calendar.event.export model_calendar_event_export base.group_user 1 1 1 1
11 access_calendar_event_import calendar.event.import model_calendar_event_import base.group_user 1 1 1 1
12 access_calendar_event_subscribe calendar.event.subscribe model_calendar_event_subscribe base.group_user 1 1 1 1
13 access_basic_calendar basic.calendar model_basic_calendar base.group_user 1 1 1 1

View File

@ -108,13 +108,13 @@ between mails and Open ERP.""",
'crm_phonecall_demo.xml'
],
'test': [
# 'test/test_crm_lead.yml',
# 'test/test_crm_meeting.yml',
# 'test/test_crm_opportunity.yml',
# 'test/test_crm_phonecall.yml',
],
'installable': True,
'active': False,
'test/test_crm_lead.yml',
'test/test_crm_meeting.yml',
'test/test_crm_opportunity.yml',
'test/test_crm_phonecall.yml',
],
'installable': True,
'active': False,
'certificate': '0079056041421',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -203,9 +203,13 @@ class crm_case(object):
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email}}
def _history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
def _history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
mailgate_pool = self.pool.get('mailgate.thread')
return mailgate_pool._history(cr, uid, cases, keyword, history=history, email=email, details=details, email_from=email_from, message_id=message_id, context=context)
return mailgate_pool._history(cr, uid, cases, keyword, history=history,\
subject=subject, email=email, \
details=details, email_from=email_from,\
message_id=message_id, attach=attach, \
context=context)
def case_open(self, cr, uid, ids, *args):
"""Opens Case
@ -438,6 +442,7 @@ class crm_case_section(osv.osv):
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Teams'),
'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"),
'note': fields.text('Description'),
'working_hours': fields.float('Working Hours', digits=(16,2 )),
}
_defaults = {

View File

@ -82,23 +82,9 @@ this if you want the rule to send an email to the partner."),
if hasattr(obj, 'categ_id'):
ok = ok and (not action.trg_categ_id or action.trg_categ_id.id==obj.categ_id.id)
# TODO: history_line is removed
# if hasattr(obj, 'history_line'):
# ok = ok and (not action.trg_max_history or action.trg_max_history<=(len(obj.history_line)+1))
# reg_history = action.regex_history
# result_history = True
# if reg_history:
# ptrn = re.compile(str(reg_history))
# if obj.history_line:
# _result = ptrn.search(str(obj.history_line[0].description))
# if not _result:
# result_history = False
regex_h = not reg_history or result_history
ok = ok and regex_h
return ok
def do_action(self, cr, uid, action, model_obj, obj, context={}):
""" @param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@ -118,7 +104,7 @@ this if you want the rule to send an email to the partner."),
write['email_cc'] = obj.email_cc+','+obj.act_email_cc
else:
write['email_cc'] = obj.act_email_cc
model_obj.write(cr, uid, [obj.id], write, context)
emails = []

View File

@ -1,59 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="event_type_case_create" model="res.partner.event.type">
<field name="name">CRM: Create Case</field>
<field name="key">crm_case_draft</field>
</record>
<record id="event_type_case_open" model="res.partner.event.type">
<field name="name">CRM: Open Case</field>
<field name="key">crm_case_open</field>
</record>
<record id="event_type_case_pending" model="res.partner.event.type">
<field name="name">CRM: Pending Case</field>
<field name="key">crm_case_pending</field>
</record>
<record id="event_type_case_cancel" model="res.partner.event.type">
<field name="name">CRM: Cancel Case</field>
<field name="key">crm_case_cancel</field>
</record>
<record id="event_type_case_close" model="res.partner.event.type">
<field name="name">CRM: Close Case</field>
<field name="key">crm_case_done</field>
</record>
</data>
<data noupdate="1">
<record model="crm.case.section" id="section_sales_department">
<field name="name">Sales Department</field>
<field name="code">Sales</field>
</record>
<record id="event_type_case_create" model="res.partner.event.type">
<field eval="False" name="active"/>
</record>
<record id="event_type_case_open" model="res.partner.event.type">
<field eval="True" name="active"/>
</record>
<record id="event_type_case_pending" model="res.partner.event.type">
<field eval="False" name="active"/>
</record>
<record id="event_type_case_close" model="res.partner.event.type">
<field eval="True" name="active"/>
</record>
<record id="event_type_case_cancel" model="res.partner.event.type">
<field eval="False" name="active"/>
</record>
<record id="ir_cron_crm_action" model="ir.cron">
<field name="name">Check cases rules</field>

View File

@ -39,7 +39,8 @@ class crm_installer(osv.osv_memory):
'crm_caldav': fields.boolean('Calendar Synchronizing', help="Help you to synchronize the meetings with other calender clients(e.g.: Sunbird)."),
'sale_crm': fields.boolean('Create Quotation from Opportunity', help="This module relates sale to opportunity cases in the CRM."),
'fetchmail': fields.boolean('Fetch Emails', help="Fetchmail Server."),
'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."),
'thunderbird': fields.boolean('Thunderbird', help="Thunderbird Interface."),
'wiki_sale_faq': fields.boolean('Sale FAQ', help="Sale FAQ."),
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):

View File

@ -35,7 +35,8 @@
<field name="crm_claim" />
<field name="crm_helpdesk" />
<field name="crm_fundraising" />
<field name="sale_crm" invisible="1"/>
<field name="wiki_sale_faq"/>
<field name="sale_crm" invisible="1"/>
</group>
</group>
</data>

View File

@ -108,8 +108,8 @@ class crm_lead(osv.osv, crm_case):
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
people will receive a copy of the future communication between partner \
and users by email"),
'description': fields.text('Description'),
'write_date': fields.datetime('Update Date' , readonly=True),
'description': fields.text('Notes'),
'write_date': fields.datetime('Update Date' , readonly=True),
# Lead fields
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
@ -137,7 +137,6 @@ and users by email"),
method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="float", store=True),
'function_name': fields.char('Function', size=64),
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\

View File

@ -12,11 +12,9 @@
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages"
groups="base.group_extended" sequence="0"
parent="menu_crm_config_lead" />
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act"
groups="base.group_extended"
parent="crm.menu_crm_case_stage" />
<!-- Resource Type Form View -->
@ -28,11 +26,10 @@
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_lead_resource_act"
id="menu_crm_lead_resource_act" name="Resource Type"
groups="base.group_extended" sequence="2"
parent="menu_crm_config_lead" />
<menuitem action="crm_lead_resource_act"
id="menu_crm_lead_resource_act"
groups="base.group_extended"
parent="crm.menu_crm_case_resource_type" />
<!-- CRM Lead Form View -->
@ -50,7 +47,7 @@
name="convert_opportunity"
string="Convert"
help="Convert to Opportunity"
icon="gtk-index"
icon="gtk-index"
type="object"/>
<newline />
<field name="section_id" colspan="1"
@ -74,7 +71,7 @@
<field name="partner_name" string="Partner Name" colspan="4"/>
<newline/>
<field domain="[('domain', '=', 'contact')]" name="title"/>
<field name="function_name" />
<field name="function" />
<field name="street" colspan="4"/>
<field name="street2" colspan="4"/>
<field name="zip"/>
@ -163,16 +160,21 @@
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
icon="gtk-undo" type="action" />
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="name" />
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
@ -180,7 +182,7 @@
</tree>
</field>
<button colspan="2" string="Send New Email"
name="%(action_crm_send_mail)d"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="gtk-go-forward" type="action" />
<button colspan="2" string="Forward to Partner"

View File

@ -13,8 +13,8 @@
<field name="context">{'object_id':'crm.meeting'}</field>
</record>
<menuitem action="crm_meeting_categ_action" name="Categories"
id="menu_crm_case_meeting-act" parent="menu_crm_config_meeting" />
<menuitem action="crm_meeting_categ_action"
id="menu_crm_case_meeting-act" parent="crm.menu_crm_case_categ" />
<!-- CRM Meetings Form View -->

View File

@ -1,23 +1,23 @@
<?xml version="1.0"?>
<openerp>
<data>
<data>
<!-- Opportunity Categories Form View -->
<!-- Opportunity Categories Form View -->
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
<field name="name">Opportunity Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
<field name="name">Opportunity Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_opportunity_categ_action"
id="menu_crm_case_opportunity-act" name="Categories" sequence="2"
parent="menu_crm_config_opportunity" />
<menuitem action="crm_opportunity_categ_action"
id="menu_crm_case_opportunity-act"
parent="crm.menu_crm_case_categ" />
<!-- Opportunity Stages Form View-->
<!-- Opportunity Stages Form View-->
<record id="crm_opportunity_stage_act" model="ir.actions.act_window">
<field name="name">Opportunity Stages</field>
@ -28,10 +28,9 @@
<field name="context">{'object_id':'crm.lead'}</field>
</record>
<menuitem action="crm_opportunity_stage_act"
id="menu_crm_opportunity_stage_act" name="Stages"
parent="menu_crm_config_opportunity" />
<menuitem action="crm_opportunity_stage_act"
id="menu_crm_opportunity_stage_act"
parent="crm.menu_crm_case_stage" />
<!-- Opportunity Resource Type Form View -->
@ -45,288 +44,307 @@
</record>
<menuitem action="crm_opportunity_resource_act"
id="menu_crm_opportunity_resource_act" name="Resource Type" sequence="3"
parent="menu_crm_config_opportunity" />
id="menu_crm_opportunity_resource_act"
parent="crm.menu_crm_case_resource_type" />
<!-- Opportunities Form View -->
<!-- Opportunities Form View -->
<record model="ir.ui.view" id="crm_case_form_view_oppor">
<field name="name">Opportunities</field>
<field name="model">crm.lead</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Opportunities">
<group colspan="4" col="7">
<field name="name" required="1" string="Opportunity"/>
<label string="Stage:" align="1.0"/>
<group colspan="1" col="4">
<field name="stage_id" nolabel="1"
on_change="onchange_stage_id(stage_id)"
widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
<button name="stage_previous"
<record model="ir.ui.view" id="crm_case_form_view_oppor">
<field name="name">Opportunities</field>
<field name="model">crm.lead</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Opportunities">
<group colspan="4" col="7">
<field name="name" required="1" string="Opportunity"/>
<label string="Stage:" align="1.0"/>
<group colspan="1" col="4">
<field name="stage_id" nolabel="1"
on_change="onchange_stage_id(stage_id)"
widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
<button name="stage_previous"
states="open,pending" type="object"
icon="gtk-go-back" string="" />
<button name="stage_next" states="open,pending"
type="object" icon="gtk-go-forward" string="" />
</group>
<field name="user_id"/>
<button name="action_makeMeeting" type="object"
string="Schedule Meeting" icon="gtk-redo" />
<field name="planned_revenue"/>
<field name="probability"/>
<field name="date_deadline" string="Expected Closing"/>
<button string="Schedule Call"
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
<newline/>
<field name="date_action"/>
<field name="priority" string="Priority"/>
</group>
<notebook colspan="4">
<page string="Opportunity">
<group col="4" colspan="2">
<separator colspan="4" string="Contacts"/>
<field name="partner_id" select="1"
on_change="onchange_partner_id(partner_id, email_from)"
colspan="2" />
<field name="partner_address_id"
string="Contact"
on_change="onchange_partner_address_id(partner_address_id, email_from)"
colspan="1" />
<field name="email_from" string="Email" />
<field name="phone"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Categorization"/>
<field name="section_id" colspan="1" widget="selection"/>
<field name="categ_id" select="1" groups="base.group_extended"
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
</group>
<separator colspan="4" string="Details"/>
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state"/>
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_pending" string="Pending"
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
groups="base.group_extended"
icon="gtk-go-up" />
<button name="case_cancel" string="Mark Lost"
states="draft,open,pending" type="object"
icon="gtk-close" />
<button name="case_close" string="Mark Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
<button name="case_reset" string="Reset to New"
states="done,cancel" type="object"
icon="gtk-convert" />
</group>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree" height="280">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="2" string="Send New Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="gtk-go-forward" type="action" />
<button colspan="2" string="Forward to Partner"
name="%(crm_lead_forward_to_partner_act)d"
icon="gtk-go-forward" type="action" />
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="write_date"/>
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group col="2" colspan="2">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="referred"/>
</group>
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</tree>
<form string="Logs">
<separator string="Action Information" colspan="4"/>
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
<!-- Opportunities Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
<field name="name">Opportunities Tree</field>
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline &lt; current_date">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Opportunity"/>
<field name="partner_id"/>
<field name="stage_id"/>
<field name="categ_id" invisible="1" groups="base.group_extended"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
icon="gtk-go-back" string="" />
<button name="stage_next" states="open,pending"
type="object" icon="gtk-go-forward" string="" />
</group>
<field name="user_id"/>
<button name="action_makeMeeting" type="object"
string="Schedule Meeting" icon="gtk-redo" />
<field name="planned_revenue"/>
<field name="probability"/>
<field name="date_deadline" string="Expected Closing"/>
<button string="Schedule Call"
name="%(opportunity2phonecall_act)d" icon="gtk-redo" type="action" />
<newline/>
<field name="date_action"/>
<field name="priority" string="Priority"/>
</group>
<notebook colspan="4">
<page string="Opportunity">
<group col="4" colspan="2">
<separator colspan="4" string="Contacts"/>
<field name="partner_id" select="1"
on_change="onchange_partner_id(partner_id, email_from)"
colspan="2" />
<field name="partner_address_id"
string="Contact"
on_change="onchange_partner_address_id(partner_address_id, email_from)"
colspan="1" />
<field name="email_from" string="Email" />
<field name="phone"/>
</group>
<group col="2" colspan="2">
<separator colspan="2" string="Categorization"/>
<field name="section_id" colspan="1" widget="selection"/>
<field name="categ_id" select="1" groups="base.group_extended"
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
</group>
<separator colspan="4" string="Details"/>
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
icon="gtk-go-forward" />
<field name="planned_revenue" sum="Total of Planned Revenue"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
<field name="date_action"/>
<field name="section_id" groups="base.group_extended"/>
<field name="user_id"/>
<field name="priority"/>
<field name="state"/>
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_pending" string="Pending"
states="draft,open" type="object"
icon="gtk-media-pause" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
groups="base.group_extended"
icon="gtk-go-up" />
<button name="case_cancel" string="Mark Lost"
states="draft,open,pending" type="object"
icon="gtk-close" />
<button name="case_close" string="Mark Won"
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
<button name="case_reset" string="Reset to New"
states="done,cancel" type="object"
icon="gtk-convert" />
</group>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<button colspan="2" string="Send New Email"
name="%(action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="gtk-go-forward" type="action" />
<button colspan="2" string="Forward to Partner"
name="%(crm_lead_forward_to_partner_act)d"
icon="gtk-go-forward" type="action" />
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator string="Dates" colspan="2"/>
<field name="create_date"/>
<field name="write_date"/>
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group col="2" colspan="2">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="referred"/>
</group>
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</tree>
<form string="Logs">
<separator string="Action Information" colspan="4"/>
<field name="name" colspan="4"/>
<field name="date"/>
<field name="user_id"/>
</form>
</field>
</page>
</notebook>
</form>
</field>
</record>
<!-- Opportunities Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
<field name="name">Opportunities Tree</field>
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline &lt; current_date">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Opportunity"/>
<field name="partner_id"/>
<field name="stage_id"/>
<field name="categ_id" invisible="1" groups="base.group_extended"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
icon="gtk-go-forward" />
<field name="planned_revenue" sum="Total of Planned Revenue"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
<field name="date_action"/>
<field name="section_id" groups="base.group_extended"/>
<field name="user_id"/>
<field name="priority"/>
<field name="state"/>
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Won"
states="open,draft,pending" type="object"
icon="gtk-apply" />
<button name="case_pending" string="Pending"
states="open,draft" type="object"
icon="gtk-media-pause" />
<button name="case_cancel" string="Lost"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
</record>
<!-- Opportunities Graph View -->
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
<field name="name">CRM - Opportunity Graph</field>
<field name="model">crm.lead</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="planned_revenue" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
<!-- Opportunities Search View -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">CRM - Opportunities Search</field>
<field name="model">crm.lead</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Opportunities">
<filter icon="terp-project"
string="Current"
name="current"
domain="[('state','in',('draft','open'))]"/>
<filter icon="terp-project"
string="Open"
domain="[('state','=','open')]"/>
<filter icon="terp-project"
string="Pending"
domain="[('state','=','pending')]"/>
<separator orientation="vertical"/>
<filter icon="gtk-home" string="Today"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','&gt;=', time.strftime('%%Y-%%m-%%d 23:59:59'))]"
help="Todays' Opportunities" />
<filter icon="gtk-media-rewind" string="7 Days"
help="Opportunities during last 7 days"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d')),\
('create_date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
/>
<separator orientation="vertical"/>
<field name="name" string="Opportunity"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]"
help="My Opportunities" default="1"/>
<filter icon="terp-partner"
domain="[('user_id','=', uid)]"
help="Unassigned Opportunities"/>
<button name="case_pending" string="Pending"
states="open,draft" type="object"
icon="gtk-media-pause" />
<button name="case_cancel" string="Lost"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
<field name="section_id"
default="context.get('section_id', False)" select="1"
widget="selection">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My Sale Team" />
</field>
<newline/>
<group expand="1" string="Group By...">
<filter string="Stage" icon="terp-crm" domain="[]"
context="{'group_by':'stage_id'}"/>
<filter string="Priority" icon="terp-crm" domain="[]"
context="{'group_by':'priority'}"/>
<filter string="Category" icon="terp-crm"
domain="[]" context="{'group_by':'categ_id'}"/>
</record>
<separator orientation="vertical"/>
<filter string="Salesman" icon="terp-crm"
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Creation" icon="terp-project"
domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Exp.Closing" icon="terp-project"
domain="[]" context="{'group_by':'date_deadline'}"/>
</group>
</search>
</field>
</record>
<!-- Opportunities Graph View -->
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
<field name="name">CRM - Opportunity Graph</field>
<field name="model">crm.lead</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="planned_revenue" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
<!-- Opportunities Search View -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">CRM - Opportunities Search</field>
<field name="model">crm.lead</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Opportunities">
<filter icon="terp-project"
string="Current"
name="current"
domain="[('state','in',('draft','open'))]"/>
<filter icon="terp-project"
string="Open"
domain="[('state','=','open')]"/>
<filter icon="terp-project"
string="Pending"
domain="[('state','=','pending')]"/>
<separator orientation="vertical"/>
<filter icon="gtk-home" string="Today"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','&gt;=', time.strftime('%%Y-%%m-%%d 23:59:59'))]"
help="Todays' Opportunities" />
<filter icon="gtk-media-rewind" string="7 Days"
help="Opportunities during last 7 days"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d')),\
('create_date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
/>
<separator orientation="vertical"/>
<field name="name" string="Opportunity"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Unassigned Opportunities" />
</field>
<field name="section_id"
default="context.get('section_id', False)" select="1"
widget="selection">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My Sale Team" />
</field>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<filter string="Stage" icon="terp-crm" domain="[]"
context="{'group_by':'stage_id'}" />
<filter string="Priority" icon="terp-crm" domain="[]"
context="{'group_by':'priority'}" />
<filter string="Category" icon="terp-crm"
domain="[]" context="{'group_by':'categ_id'}" />
<separator orientation="vertical" />
<filter string="Salesman" icon="terp-crm"
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}" />
<separator orientation="vertical" />
<filter string="Creation" icon="terp-project"
domain="[]" context="{'group_by':'create_date'}" />
<filter string="Exp.Closing" icon="terp-project"
domain="[]" context="{'group_by':'date_deadline'}" />
</group>
</search>
</field>
</record>
<!-- Opportunities Graph View -->
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
<field name="name">CRM - Opportunity Graph</field>
<field name="model">crm.lead</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="planned_revenue" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
</data>
</openerp>

View File

@ -38,6 +38,9 @@ class crm_phonecall(osv.osv, crm_case):
'name': fields.char('Name', size=64),
'active': fields.boolean('Active', required=False),
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
'create_date': fields.datetime('Creation Date' , readonly=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),

View File

@ -13,8 +13,8 @@
<field name="context">{'object_id':'crm.phonecall'}</field>
</record>
<menuitem action="crm_phonecall_categ_action" name="Categories"
id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" />
<menuitem action="crm_phonecall_categ_action"
id="menu_crm_case_phonecall-act" parent="crm.menu_crm_case_categ" />
<!-- ResourceType Form View -->
@ -27,9 +27,10 @@
<field name="context">{'object_id':'crm.phonecall'}</field>
</record>
<menuitem action="crm_phonecall_resource_act"
id="menu_crm_phonecall_resource_act" name="Resource Type"
parent="menu_crm_config_phonecall" />
<menuitem action="crm_phonecall_resource_act"
id="menu_crm_phonecall_resource_act"
parent="crm.menu_crm_case_resource_type" />
<!-- PhoneCalls Tree View -->

View File

@ -1,20 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem id="base.menu_crm_config_sales" name="Sales"
parent="base.menu_base_config" sequence="1" groups="base.group_extended"/>
<menuitem id="menu_crm_config_lead" name="Lead"
parent="base.menu_crm_config_sales" sequence="0" groups="base.group_extended"/>
<menuitem id="menu_crm_config_opportunity" name="Opportunity"
parent="base.menu_crm_config_sales" sequence="1" groups="base.group_extended"/>
<menuitem id="menu_crm_config_meeting" name="Meeting"
parent="base.menu_base_config" sequence="4" groups="base.group_extended"/>
<menuitem id="menu_crm_config_phonecall" name="Phone Call"
parent="base.menu_base_config" sequence="5" groups="base.group_extended"/>
<menuitem id="base.menu_crm_configuration" name="Cases"
parent="base.menu_base_config" sequence="0" groups="base.group_extended"/>
<menuitem id="base.next_id_64" name="Reporting"
parent="base.menu_base_partner" sequence="8" />
@ -129,7 +117,9 @@
<field name="view_id" ref="crm_case_stage_tree"/>
</record>
<!-- Case Categories Form View -->
<menuitem id="menu_crm_case_stage" name="Stages" parent="base.menu_crm_configuration" groups="base.group_extended"/>
<!-- Case Categories Form View -->
<record id="crm_case_categ-view" model="ir.ui.view">
<field name="name">crm.case.categ.form</field>
@ -166,11 +156,11 @@
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_categ_tree-view"/>
</record>
<menuitem id="menu_crm_case_categ" name="Categories" parent="base.menu_crm_configuration" groups="base.group_extended"/>
<menuitem action="crm_case_section_act"
id="menu_crm_case_section_act" sequence="4"
parent="base.menu_crm_config_sales" />
id="menu_crm_case_section_act"
parent="base.menu_crm_configuration" />
<!-- Resource Type of case Tree View -->
@ -211,6 +201,8 @@
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_resource_type_tree"/>
</record>
<menuitem id="menu_crm_case_resource_type" name="Resource Type"
parent="base.menu_crm_configuration" groups="base.group_extended" />
<record id="crm_case_section_act_tree" model="ir.actions.act_window">
<field name="name">Cases by section</field>
@ -350,11 +342,10 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="crm_segmentation_tree-act"
<menuitem action="crm_segmentation_tree-act"
id="menu_crm_segmentation-act"
groups="base.group_extended" sequence="5"
parent="base.menu_crm_config_sales" />
groups="base.group_extended"
parent="base.menu_crm_configuration" />
<record model="ir.ui.view" id="view_users_form_simple_modif_inherited1">
<field name="name">view.users.form.crm.modif.inherited1</field>

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm

View File

@ -7,13 +7,13 @@ 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-01-22 23:56+0000\n"
"Last-Translator: Paulino <Unknown>\n"
"PO-Revision-Date: 2010-06-01 14:21+0000\n"
"Last-Translator: cmsa <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:02+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
@ -34,7 +34,7 @@ msgstr ""
#: help:crm.case.rule,act_mail_to_user:0
msgid ""
"Check this if you want the rule to send an email to the responsible person."
msgstr ""
msgstr "Marque isto se quer que a regra envie um email ao responsável."
#. module: crm
#: view:crm.meeting:0
@ -57,7 +57,7 @@ msgstr "Fechar dica"
#: view:crm.opportunity:0
#: view:crm.phonecall:0
msgid " 7 Days "
msgstr ""
msgstr " 7 Dias "
#. module: crm
#: help:crm.menu.config_wizard,helpdesk:0
@ -67,7 +67,7 @@ msgstr "Gere um serviço de Helpdesk"
#. module: crm
#: view:crm.job:0
msgid "Pending Jobs"
msgstr ""
msgstr "Tarefas Pendentes"
#. module: crm
#: field:crm.case.rule,trg_state_to:0
@ -82,7 +82,7 @@ msgstr "Custos previstos"
#. module: crm
#: wizard_field:crm.job.partner_create,init,close:0
msgid "Close job request"
msgstr ""
msgstr "Fechar tarefa requerida"
#. module: crm
#: field:crm.case.stage,name:0
@ -191,6 +191,8 @@ msgid ""
"Describes the action name.eg:on which object which ation to be taken on "
"basis of which condition"
msgstr ""
"Descreve o nome da acção . Ou seja, em que Objecto, que acção e em que "
"condições"
#. module: crm
#: help:crm.case,section_id:0
@ -238,7 +240,7 @@ msgstr "Salário proposto"
#. module: crm
#: help:crm.case.section,sequence:0
msgid "Gives the sequence order when displaying a list of case sections."
msgstr ""
msgstr "Devolve a ordem de sequência quando apresenta as secções de opções"
#. module: crm
#: code:addons/crm/wizard/crm_job_wizard.py:0
@ -3619,6 +3621,8 @@ msgstr ""
msgid ""
"Can not send mail with empty body,you should have description in the body"
msgstr ""
"Não pode enviar um email sem corpo de texto, deve inserir texto no corpo do "
"email."
#. module: crm
#: selection:report.crm.case.section.categ.categ2,month:0

View File

@ -35,7 +35,7 @@ class crm_lead_report(osv.osv):
_name = "crm.lead.report"
_auto = False
_description = "CRM Lead Report"
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
""" @param cr: the current row, from the database cursor,
@ -89,7 +89,10 @@ class crm_lead_report(osv.osv):
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'email': fields.integer('# of Emails', size=128, readonly=True),
'expected_closing_days': fields.integer('# of Expected Closing Days', size=128, readonly=True),
'delay_open': fields.float('Delay to open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'categ_id': fields.many2one('crm.case.categ', 'Category',\
domain="[('section_id','=',section_id),\
@ -98,11 +101,10 @@ class crm_lead_report(osv.osv):
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]", readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner' , readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'type':fields.selection([
('lead','Lead'),
('opportunity','Opportunity'),
],'Type', help="Type is used to separate Leads and Opportunities"),
}
def init(self, cr):
@ -132,13 +134,28 @@ class crm_lead_report(osv.osv):
0 as avg_answers,
0.0 as perc_done,
0.0 as perc_cancel,
(select count(id) from mailgate_message where thread_id=c.id) as email,
date_trunc('day',c.create_date) as create_date,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close
sum(cast(to_char(date_trunc('day',c.date_open) - date_trunc('day',c.date_deadline),'DD') as int)) as expected_closing_days,
avg(extract('epoch' from (c.date_closed-c.create_date)))/(3600*24) as delay_close,
avg(extract('epoch' from (c.date_open-c.create_date)))/(3600*24) as delay_open
from
crm_lead c
group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'),\
c.state, c.user_id,c.section_id,c.stage_id,categ_id,c.partner_id,c.company_id, c.type
,c.create_date,to_char(c.create_date, 'YYYY-MM-DD')
group by
to_char(c.create_date, 'YYYY'),
to_char(c.create_date, 'MM'),
c.state,
c.user_id,
c.id,
c.section_id,
c.stage_id,
categ_id,
c.partner_id,
c.company_id,
c.type,
c.create_date,
to_char(c.create_date, 'YYYY-MM-DD')
)""")
crm_lead_report()

View File

@ -144,7 +144,7 @@
<field name="model">crm.lead.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities">
<tree string="Opportunities Analysis">
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="section_id" invisible="1" groups="base.group_extended"/>
@ -153,7 +153,10 @@
<field name="partner_id" invisible="1"/>
<field name="day" invisible="1"/>
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
<field name="delay_close" sum='Avg Closing Delay'/>
<field name="email" sum="# of Emails"/>
<field name="expected_closing_days" sum='# of Expected Closing Days'/>
<field name="delay_open" sum='Delay to open'/>
<field name="delay_close" sum='Delay to close'/>
<field name="state" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
@ -188,8 +191,8 @@
<field name="act_window_id" ref="action_report_crm_lead"/>
</record>
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
<field name="name">Opportunities</field>
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
<field name="name">Opportunities Analysis</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="context">{"search_default_User":1,"search_default_This Month":1,'group_by_no_leaf':1,'group_by':[]}</field>
@ -216,7 +219,7 @@
groups="base.group_extended"
parent="base.next_id_64" action="action_report_crm_lead" />
<menuitem name="Opportunities" id="menu_report_crm_opportunities_tree"
<menuitem name="Opportunities Analysis" id="menu_report_crm_opportunities_tree"
groups="base.group_extended"
parent="base.next_id_64" action="action_report_crm_opportunity" />

View File

@ -27,10 +27,12 @@ class res_partner(osv.osv):
_columns = {
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
'Opportunities', domain=[('type', '=', 'opportunity')]),
'Opportunities', readonly=True, \
domain=[('type', '=', 'opportunity')]),
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
'Meetings'),
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
'Meetings', readonly=True),
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
'Phonecalls', readonly=True),
}
res_partner()

View File

@ -10,52 +10,54 @@
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="CRM">
<field name="meeting_ids" colspan="4" nolabel="1" />
<field name="phonecall_ids" colspan="4" nolabel="1" />
<field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="create_date"/>
<field name="partner_name"/>
<field name="name"/>
<field name="email_from"/>
<field name="phone"/>
<field name="categ_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="stage_id"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
icon="gtk-go-forward" />
<field name="section_id"
invisible="context.get('invisible_section', True)" />
<field name="user_id" />
<field name="state" />
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Close"
states="open,draft,pending" type="object"
icon="gtk-close" />
<button string="Convert to Opportunity"
name="convert_opportunity"
states="draft,open,pending" icon="gtk-index"
type="object" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
icon="gtk-go-up" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
</page>
</notebook>
<xpath expr="//notebook[last()]" position="after">
<notebook colspan="4">
<page string="CRM">
<field name="meeting_ids" colspan="4" nolabel="1" />
<field name="phonecall_ids" colspan="4" nolabel="1" />
<field name="opportunity_ids" colspan="4" nolabel="1" domain="[('type', '=', 'opportunity')]">
<tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="create_date"/>
<field name="partner_name"/>
<field name="name"/>
<field name="email_from"/>
<field name="phone"/>
<field name="categ_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="stage_id"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
states="open,pending" type="object"
icon="gtk-go-forward" />
<field name="section_id"
invisible="context.get('invisible_section', True)" />
<field name="user_id" />
<field name="state" />
<button name="case_open" string="Open"
states="draft,pending" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Close"
states="open,draft,pending" type="object"
icon="gtk-close" />
<button string="Convert to Opportunity"
name="convert_opportunity"
states="draft,open,pending" icon="gtk-index"
type="object" />
<button name="case_escalate" string="Escalate"
states="open,draft,pending" type="object"
icon="gtk-go-up" />
<button name="case_cancel" string="Cancel"
states="draft,open,pending" type="object"
icon="gtk-cancel" />
</tree>
</field>
</page>
</notebook>
</xpath>
</field>
</record>

View File

@ -117,7 +117,7 @@ class Contact
"email_from" => new xmlrpcval($post['email'], "string"),
"phone" => new xmlrpcval($post['phone'], "string"),
"partner_name" => new xmlrpcval($post['name'], "string"),
"function_name" => new xmlrpcval($post["jobtitle"], "string"),
"function" => new xmlrpcval($post["jobtitle"], "string"),
"zip" => new xmlrpcval($post['zip'], "string"),
"stage_id" => new xmlrpcval(6, "int"),
"city" => new xmlrpcval($post['city'], "string"),

View File

@ -26,3 +26,4 @@
"access_crm_lead2opportunity_partner","crm.lead2opportunity.partner","model_crm_lead2opportunity_partner","crm.group_crm_user",1,1,1,1
"access_crm_installer","crm.installer.rule","model_crm_installer","crm.group_crm_user",1,1,1,1
"access_crm_lead_forward_to_partner","crm.lead.forward.to.partner","model_crm_lead_forward_to_partner","crm.group_crm_user",2,2,2,2
"access_mailgate_thread","mailgate.thread","model_mailgate_thread","crm.group_crm_user",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
26 access_crm_lead2opportunity_partner crm.lead2opportunity.partner model_crm_lead2opportunity_partner crm.group_crm_user 1 1 1 1
27 access_crm_installer crm.installer.rule model_crm_installer crm.group_crm_user 1 1 1 1
28 access_crm_lead_forward_to_partner crm.lead.forward.to.partner model_crm_lead_forward_to_partner crm.group_crm_user 2 2 2 2
29 access_mailgate_thread mailgate.thread model_mailgate_thread crm.group_crm_user 1 1 1 1

View File

@ -82,9 +82,9 @@
- |
I can check that a lead and a business opportunity is now assigned to this
lead.
-
# !python {model: crm.lead, id: crm_lead_newcustomer0}:
# - opportunity_id == False
#-
# !python {model: crm.lead, id: crm_lead_newcustomer0}:
# - opportunity_id == False
- |
I check that the partner associated to this lead as the same country, phone number
@ -97,10 +97,11 @@
opportunity = obj_opportunity.browse(cr, uid, ids)[0]
assert lead.partner_name == opportunity.partner_id.name
assert lead.phone == opportunity.phone
-
|
# yaml is also not working smpt server and send new email.
#-
# |
# yaml is also not working smpt server and send new email.
- |
I configure with smtp server.
- |
@ -113,4 +114,4 @@
- |
I Reply to last Email to lead with some document attached.and check that communication history generated or not.

View File

@ -212,7 +212,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
lead = lead_proxy.browse(cr, uid, lead_id, context=context)
if lead.type == 'lead':
field_names = [
'partner_name', 'title', 'function_name', 'street', 'street2',
'partner_name', 'title', 'function', 'street', 'street2',
'zip', 'city', 'country_id', 'state_id', 'email_from',
'phone', 'fax', 'mobile'
]

View File

@ -155,7 +155,7 @@ class crm_lead2partner(osv.osv_memory):
'email': lead.email_from,
'fax': lead.fax,
'title': lead.title,
'function': lead.function_name,
'function': lead.function,
'street': lead.street,
'street2': lead.street2,
'zip': lead.zip,

View File

@ -99,7 +99,7 @@ class crm_send_new_email(osv.osv_memory):
model = hist.model_id.model
model_pool = self.pool.get(model)
res_ids = model_pool.search(cr, uid, [('thread_id','=', hist.thread_id.id)])
res_id = res_ids and res_ids[0] or False
res_id = res_ids and res_ids[0] or False
case = model_pool.browse(cr, uid, res_id)
emails = [obj.email_to] + (obj.email_cc or '').split(',')
emails = filter(None, emails)
@ -107,7 +107,11 @@ class crm_send_new_email(osv.osv_memory):
body = case_pool.format_body(body)
email_from = getattr(obj, 'email_from', False)
case_pool._history(cr, uid, [case], _('Send'), history=True, email=obj.email_to, details=body, email_from=email_from, message_id=message_id)
case_pool._history(cr, uid, [case], _('Send'), history=True, \
email=obj.email_to, details=body, \
subject=obj.subject, email_from=email_from, \
message_id=message_id, attach=attach)
x_headers = dict()
#x_headers = {

View File

@ -179,31 +179,38 @@
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.claim'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<button colspan="4" string="Send New Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.claim'}"
icon="gtk-go-forward" type="action" />
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree" height="280">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="4" string="Send New Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.claim'}"
icon="gtk-go-forward" type="action" />
</page>
</notebook>

View File

@ -200,18 +200,25 @@
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.fundraising'}"
icon="gtk-undo" type="action" />
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.fundraising'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="4" string="Send New Email"

View File

@ -139,18 +139,25 @@
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.helpdesk'}"
icon="gtk-undo" type="action" />
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.helpdesk'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="4" string="Send New Email"

View File

@ -26,7 +26,7 @@
'category': 'Generic Modules/Others',
'description': """This is a complete document management system:
* User Authentication
* Document Indexation
* Document Indexation :- .pptx and .docx files are not support in windows platform.
ATTENTION:
- When you install this module in a running company that have already PDF files stored into the database,

View File

@ -75,7 +75,7 @@ class document_file(osv.osv):
'user_id': fields.many2one('res.users', 'Owner', select=1),
'group_ids': fields.many2many('res.groups', 'document_group_rel', 'item_id', 'group_id', 'Groups'),
# the directory id now is mandatory. It can still be computed automatically.
'parent_id': fields.many2one('document.directory', 'Directory', select=1, required=True),
'parent_id': fields.many2one('document.directory', 'Directory', select=1),
'file_size': fields.integer('File Size', required=True),
'file_type': fields.char('Content Type', size=128),
# If ir.attachment contained any data before document is installed, preserve
@ -88,11 +88,16 @@ class document_file(osv.osv):
'create_uid': fields.many2one('res.users', 'Creator', readonly=True),
'store_method': fields.selection([('db', 'Database'), ('fs', 'Filesystem'), ('link', 'Link')], "Storing Method"),
'datas': fields.function(_data_get, method=True, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True),
'url': fields.char('File URL',size=64),
'store_fname': fields.char('Stored Filename', size=200),
'res_model': fields.char('Attached Model', size=64), #res_model
'res_id': fields.integer('Attached ID'), #res_id
'partner_id':fields.many2one('res.partner', 'Partner', select=1),
'title': fields.char('Resource Title', size=64),
'type':fields.selection([
('url','URL'),
('binary','Binary'),
],'Type', help="Type is used to separate URL and binary File"),
}
def __get_def_directory(self, cr, uid, context=None):
@ -103,6 +108,7 @@ class document_file(osv.osv):
'user_id': lambda self, cr, uid, ctx:uid,
'file_size': lambda self, cr, uid, ctx:0,
'store_method': lambda *args: 'db',
'type': 'binary',
'parent_id': __get_def_directory
}
_sql_constraints = [
@ -155,7 +161,6 @@ class document_file(osv.osv):
def create(self, cr, uid, vals, context=None):
if not context:
context = {}
vals['title'] = vals['name']
vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
if not vals['parent_id']:
vals['parent_id'] = self.pool.get('document.directory')._get_root_directory(cr,uid, context)
@ -168,8 +173,6 @@ class document_file(osv.osv):
result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context)
if len(result):
obj = result[0]
if obj.get('name', False):
vals['title'] = (obj.get('name', ''))[:60]
if obj_model._name == 'res.partner':
vals['partner_id'] = obj['id']
elif obj.get('address_id', False):

View File

@ -104,11 +104,9 @@ class document_directory(osv.osv):
]
def name_get(self, cr, uid, ids, context={}):
res = []
all_ids = self.search(cr,uid,[])
if not self.search(cr,uid,[('id','in',ids)]):
ids = []
for d in self.browse(cr, uid, ids, context=context):
if d.id not in all_ids:
continue
s = ''
d2 = d
while d2 and d2.parent_id:

View File

@ -118,7 +118,7 @@
<record model="ir.ui.view" id="view_document_directory_tree">
<field name="name">document.directory</field>
<field name="model">document.directory</field>
<field name="type">tree</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Directories" toolbar="1">
<field name="name"/>
@ -179,71 +179,96 @@
<form string="Documents">
<group colspan="4" col="6">
<field name="name" select="1" />
<field name="title" select="1"/>
<field name="partner_id"/>
<field name="user_id"/>
<field name="parent_id"/>
<field name="type"/>
<field name="parent_id"/>
</group>
<notebook colspan="4">
<page string="Attachment">
<group col="2" colspan="2">
<separator string="Data" colspan="2"/>
<group col="2" colspan="2" attrs="{'invisible':[('type','=','url')]}">
<field name="datas" filename="datas_fname"/>
<field name="datas_fname" select="1"/>
</group>
<group col="2" colspan="2">
<separator string="Attached To" colspan="2"/>
<field name="res_model" readonly="1"/>
<field name="res_id" readonly="1"/>
</group>
<separator string="Preview" colspan="4"/>
<field
name="preview"
widget="image"
readonly="1"
nolabel="1"
colspan="4"
img_height="400"
img_width="800"/>
</group>
<group col="2" colspan="2" attrs="{'invisible':[('type','=','binary')]}">
<field name="url" widget="url"/>
</group>
</page><page string="Indexed Content">
<field name="index_content" nolabel="1" colspan="4" select="1"/>
</page><page string="Security">
<field name="group_ids" colspan="4" nolabel="1"/>
</page><page string="Others Info">
<group colspan="4" col="4">
<separator string="File Information" colspan="4"/>
<field name="file_size" readonly="1"/>
<newline/>
</group>
<group col="2" colspan="2">
<separator string="Relation" colspan="2"/>
<field name="res_name" readonly="1"/>
<field name="partner_id"/>
<field name="user_id"/>
</group>
<group col="4" colspan="4">
<separator string="History" colspan="4"/>
<group col="4" colspan="4">
<field name="create_uid"/>
<field name="create_date"/>
</group>
<group col="4" colspan="4">
<field name="write_uid"/>
<field name="write_date"/>
</group>
</group>
</page><page string="Notes">
</page>
<page string="Security">
<field name="group_ids" colspan="4" nolabel="1"/>
</page>
<page string="Notes">
<field colspan="4" name="description" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_attach_filter" model="ir.ui.view">
<field name="name">IR Attachment</field>
<field name="model">ir.attachment</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="IR Attachment">
<filter icon="gtk-media-rewind" string="Recent"
help="less 1 month modified/created attachments"
domain="[('create_date','&lt;=', time.strftime('%%Y-%%m-%%d')),('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Filter on my Attachment" />
</field>
<field name="partner_id" widget="selection"/>
<newline/>
<group expand="1" string="Group By...">
<filter string="Partner" icon="terp-partner" domain="[]"
context="{'group_by':'partner_id'}" />
<filter string="Directory" icon="gtk-open" domain="[]" context="{'group_by':'parent_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="view_document_file_tree">
<field name="name">ir.attachment</field>
<field name="model">ir.attachment</field>
<field name="type">tree</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<tree string="Documents">
<tree colors="blue:type in ('url')" string="Documents">
<field name="name"/>
<field name="title" />
<field name="partner_id"/>
<field name="type"/>
<field name="datas_fname"/>
<field name="user_id"/>
<field name="create_date"/>
<field name="write_date"/>
</tree>
</field>
</record>

View File

@ -44,7 +44,6 @@ class report_document_user(osv.osv):
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
'user_id':fields.integer('Owner', readonly=True),
'user':fields.char('User',size=64,readonly=True),
'file_title': fields.char('File Name',size=64,readonly=True),
'directory': fields.char('Directory',size=64,readonly=True),
'create_date': fields.datetime('Date Created', readonly=True),
'change_date': fields.datetime('Modified Date', readonly=True),
@ -66,7 +65,6 @@ class report_document_user(osv.osv):
d.name as directory,
f.create_date as create_date,
f.file_size as file_size,
min(f.title) as file_title,
min(d.type) as type,
f.write_date as change_date
from ir_attachment f
@ -83,7 +81,6 @@ class report_files_partner(osv.osv):
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'file_title': fields.char('File Name',size=64,readonly=True),
'directory': fields.char('Directory',size=64,readonly=True),
'create_date': fields.datetime('Date Created', readonly=True),
'change_date': fields.datetime('Modified Date', readonly=True),
@ -101,7 +98,6 @@ class report_files_partner(osv.osv):
select min(f.id) as id,count(*) as nbr,
to_char(f.create_date,'YYYY') as name,
min(to_char(f.create_date,'MM')) as month,
min(f.title) as file_title,
p.name as partner
from ir_attachment f
inner join res_partner p
@ -145,7 +141,6 @@ class report_document_wall(osv.osv):
'user_id':fields.many2one('res.users', 'Owner',readonly=True),
'user':fields.char('User',size=64,readonly=True),
'month': fields.char('Month', size=24,readonly=True),
'file_name':fields.char('Last Posted File Name',size=64,readonly=True),
'last':fields.datetime('Last Posted Time', readonly=True),
}
@ -153,7 +148,6 @@ class report_document_wall(osv.osv):
cr.execute("""
create or replace view report_document_wall as (
select max(f.id) as id,
min(title) as file_name,
to_char(min(f.create_date),'YYYY-MM-DD HH24:MI:SS') as last,
f.user_id as user_id, f.user_id as user,
to_char(f.create_date,'Month') as month

View File

@ -8,7 +8,6 @@
<field name="arch" type="xml">
<form string="Files">
<field name="name" select="1"/>
<field name="file_title" select="1"/>
<field name="user" select="1"/>
<field name="directory" select="1"/>
<field name="file_size"/>
@ -26,7 +25,6 @@
<tree string="Files">
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="file_title"/>
<field name="user" select="1"/>
<field name="directory" select="1"/>
<field name="file_size"/>
@ -48,7 +46,6 @@
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="file_title" select="1"/>
<field name="user" select="1"/>
<field name="directory" select="1"/>
</group>
@ -79,13 +76,11 @@
<form string="Wall of Shame">
<field name="user_id" select="1"/>
<field name="month" select="1"/>
<field name="file_name" select="1"/>
<field name="last"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_document_wall_tree">
<field name="name">report.document.wall.tree</field>
<field name="model">report.document.wall</field>
@ -94,7 +89,6 @@
<tree string="Wall of Shame">
<field name="user_id" select="1"/>
<field name="month" select="1"/>
<field name="file_name"/>
<field name="last"/>
</tree>
</field>

View File

@ -57,6 +57,7 @@ class PptxIndex(indexer):
return ['.pptx']
def _doIndexFile(self,fname):
# pptx2txt.pl package not support in windows platform.
# Download pptx2txt package from http://sourceforge.net/projects/pptx2txt/" link.
# To install this tool, just copy pptx2txt.pl to appropriate place (e.g. /usr/bin directory)
fp = Popen(['pptx2txt.pl', fname], shell=False, stdout=PIPE).stdout
@ -88,6 +89,7 @@ class DocxIndex(indexer):
return ['.docx']
def _doIndexFile(self,fname):
# docx2txt.pl package not support in windows platform.
# Download docx2txt package from "http://sourceforge.net/projects/docx2txt/" link.
# In case, you don't want to use Makefile for installation, you can follow these steps for manual installation.
# Copy docx2txt.pl, docx2txt.sh and docx2txt.config to appropriate place (e.g. /usr/bin directory) . used following command.

View File

@ -558,8 +558,7 @@ class abstracted_fs:
if dst_obj2:
ressource_type_id = pool.get('ir.model').search(cr, uid, [('model','=',dst_obj2._name)])[0]
ressource_id = dst_obj2.id
title = dst_obj2.name
ressource_id = dst_obj2.id
ressource_model = dst_obj2._name
if dst_obj2._name == 'res.partner':
partner_id = dst_obj2.id
@ -569,8 +568,7 @@ class abstracted_fs:
ressource_type_id = False
ressource_id = False
ressource_model = False
partner_id = False
title = False
partner_id = False
pool.get('document.directory').write(cr, uid, result['directory'], {
'name' : dst_basename,
'ressource_id': ressource_id,
@ -579,8 +577,7 @@ class abstracted_fs:
})
val = {
'res_id': ressource_id,
'res_model': ressource_model,
'title': title,
'res_model': ressource_model,
'partner_id': partner_id
}
pool.get('ir.attachment').write(cr, uid, result['attachment'], val)
@ -603,7 +600,6 @@ class abstracted_fs:
'res_model': False,
'name': dst_basename,
'datas_fname': dst_basename,
'title': dst_basename,
}
if (dst_obj and (dst_obj.type in ('directory','ressource'))) or not dst_obj2:
@ -613,8 +609,7 @@ class abstracted_fs:
if dst_obj2:
val['res_model'] = dst_obj2._name
val['res_id'] = dst_obj2.id
val['title'] = dst_obj2.name
val['res_id'] = dst_obj2.id
if dst_obj2._name == 'res.partner':
val['partner_id'] = dst_obj2.id
else:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

View File

@ -223,25 +223,32 @@
<page string="History">
<field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'event.registration'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<field name="log_ids" nolabel="1" colspan="4" mode="tree,form" readonly="1">
<tree string="Actions">
<separator string="Action Information" colspan="4"/>

View File

@ -69,7 +69,7 @@ class event_make_invoice(osv.osv_memory):
inv_rej_reason += "ID "+str(reg.id)+": Registration doesn't have any partner to invoice. \n"
continue
else:
val_invoice = pool_obj.get('account.invoice').onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
val_invoice = inv_obj.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False)
val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id})
partner_address_id = val_invoice['value']['address_invoice_id']

View File

@ -7,6 +7,7 @@
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey.survey_type1"/>
<field name="responsible_id" ref="base.user_demo"/>
<field name="response_user">5</field>
</record>
</data>
<data>
@ -16,6 +17,7 @@
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey.survey_type1"/>
<field name="responsible_id" ref="base.user_root"/>
<field name="response_user">5</field>
</record>
</data>
<data>

View File

@ -148,6 +148,7 @@
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey.survey_type1"/>
<field name="responsible_id" ref="base.user_root"/>
<field name="response_user">5</field>
</record>
</data>
<data>

View File

@ -159,26 +159,33 @@
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'hr.applicant'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'hr.applicant'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="4" string="Send New Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'hr.applicant'}"

View File

@ -43,7 +43,7 @@ class hr_analytic_timesheet(osv.osv):
_inherits = {'account.analytic.line': 'line_id'}
_order = "id desc"
_columns = {
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id',relation='account.analytic.account',store=True),
}
@ -57,8 +57,7 @@ class hr_analytic_timesheet(osv.osv):
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}):
res = {}
# if prod_id and unit_amount:
if prod_id:
if prod_id and unit_amount:
# find company
company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context)
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount,company_id,unit, context)

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n"
"X-Launchpad-Export-Date: 2010-06-02 03:33+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: idea

View File

@ -22,6 +22,7 @@
from osv import osv
from osv import fields
from tools.translate import _
import time
VoteValues = [('-1', 'Not Voted'), ('0', 'Very Bad'), ('25', 'Bad'), \
('50', 'Normal'), ('75', 'Good'), ('100', 'Very Good') ]
@ -150,13 +151,12 @@ class idea_idea(osv.osv):
if int(field_value) >= 0:
vote_obj.create(cr, uid, {'idea_id': id, 'user_id': uid, 'score': textual_value })
_columns = {
'user_id': fields.many2one('res.users', 'Creator', required=True, readonly=True),
'user_id': fields.many2one('res.users', 'Responsible', required=True, readonly=True),
'title': fields.char('Idea Summary', size=64, required=True),
'description': fields.text('Description', required=True, help='Content of the idea'),
'comment_ids': fields.one2many('idea.comment', 'idea_id', 'Comments'),
'create_date': fields.datetime('Creation date', readonly=True),
'created_date': fields.datetime('Creation date', readonly=True),
'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'),
'my_vote': fields.function(_vote_read, fnct_inv = _vote_save, string="My Vote", method=True, type="selection", selection=VoteValues),
'vote_avg': fields.function(_vote_avg_compute, method=True, string="Average Score", type="float"),
@ -174,12 +174,16 @@ class idea_idea(osv.osv):
),
'visibility':fields.boolean('Open Idea?', required=False),
'stat_vote_ids': fields.one2many('idea.vote.stat', 'idea_id', 'Statistics', readonly=True),
'vote_limit': fields.integer('Maximum Vote per User',
help="Set to one if you require only one Vote per user"),
}
_defaults = {
'user_id': lambda self,cr,uid,context: uid,
'my_vote': lambda *a: '-1',
'state': lambda *a: 'draft',
'vote_limit': lambda * a: 1,
'created_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'visibility': lambda *a: True,
}
_order = 'id desc'
@ -278,12 +282,15 @@ class idea_vote(osv.osv):
_rec_name = 'score'
_columns = {
'user_id': fields.many2one('res.users', 'User'),
'idea_id': fields.many2one('idea.idea', 'Idea', required=True, ondelete='cascade'),
'score': fields.selection(VoteValues, 'Score', required=True)
'user_id': fields.many2one('res.users', 'By user', readonly="True"),
'idea_id': fields.many2one('idea.idea', 'Idea', readonly="True", ondelete='cascade'),
'score': fields.selection(VoteValues, 'Vote Status', readonly="True"),
'date': fields.datetime('Date', readonly="True"),
'comment': fields.text('Comment', readonly="True"),
}
_defaults = {
'score': lambda *a: DefaultVoteValue,
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
idea_vote()

View File

@ -50,6 +50,7 @@
<menuitem name="Categories" parent="menu_ideas" id="menu_idea_category" action="action_idea_category" />
<!-- Idea Category Action -->
<record model="ir.actions.act_window" id="action_idea_category_tree">
@ -60,8 +61,18 @@
</record>
<menuitem name="Ideas" parent="base.menu_tools" id="menu_ideas1" sequence="4"/>
<menuitem
name="Ideas by Categories" parent="menu_ideas1"
id="menu_idea_category_tree"
action="action_idea_category_tree"/>
<menuitem name="Give Vote" parent="menu_ideas1"
id="menu_give_vote"
action="action_idea_select"/>
<!-- Oepn Ideas Action -->
<!-- Open Ideas Action -->
<record model="ir.actions.act_window" id="action_idea_idea_categ_open">
<field name="name">Open Ideas</field>
@ -102,9 +113,9 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Votes">
<field name="idea_id"/>
<field name="user_id"/>
<field name="score" />
<field name="user_id" />
<field name="score"/>
<field name="date"/>
</tree>
</field>
</record>
@ -117,12 +128,39 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Votes">
<field name="idea_id" select="1" />
<field name="user_id" select="1" />
<field name="score"/>
<group colspan="4">
<field name="user_id" select="1" />
<field name="date"/>
<newline/>
<field name="score"/>
</group>
<separator string="Comments:" colspan="4"/>
<field name="comment" colspan="4" nolabel="1"/>
</form>
</field>
</record>
<!-- Search view for Idea vote -->
<record model="ir.ui.view" id="view_idea_vote_search">
<field name="name">idea.vote.search</field>
<field name="model">idea.vote</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Ideas vote">
<group col="10" colspan="4">
<field name="idea_id" widget="selection"/>
<field name="user_id" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="14">
<filter string="Vote date" icon="terp-crm" domain="[]" context="{'group_by':'date'}"/>
<filter string="Idea" icon="terp-crm" domain="[]" context="{'group_by':'idea_id'}"/>
<filter string="User" name="user" icon="terp-partner" domain="[]" context="{'group_by':'user_id'}"/>
</group>
</search>
</field>
</record>
<!-- New Idea Form View -->
@ -168,7 +206,8 @@
<field name="score"/>
<field name="nbr"/>
</tree>
</field>
</field>
</page>
</notebook>
<group colspan="4" col="6">
@ -177,7 +216,6 @@
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" states="open" type="action" string="Submit Vote"/>
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
</group>
</form>
</field>
@ -190,15 +228,15 @@
<field name="model">idea.idea</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="All Ideas">
<tree string="Ideas">
<field name="title"/>
<field name="category_id" />
<field name="create_date"/>
<field name="created_date"/>
<field name="vote_avg" widget="progressbar"/>
<field name="count_comments" />
<field name="count_votes" />
<field name="state"/>
<button name="%(action_idea_post_vote)d" icon="gtk-execute" type="action" states="draft,open" string="Vote"/>
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" type="action" states="open" string="Submit Vote"/>
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
</tree>
@ -233,23 +271,6 @@
</field>
</record>
<!-- Comments on Idea Tree View -->
<record model="ir.ui.view" id="view_idea_comment_tree">
<field name="name">idea.comment.tree</field>
<field name="model">idea.comment</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Comments">
<field name="create_date" />
<field name="user_id" />
<field name="content" string="Comment" />
</tree>
</field>
</record>
<!-- Idea Action -->
<record model="ir.actions.act_window" id="action_idea_idea">
<field name="name">Ideas</field>
<field name="res_model">idea.idea</field>
@ -337,9 +358,10 @@
<field name="res_model">idea.vote</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_idea_vote_search"/>
</record>
<menuitem name="All Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
<menuitem name="Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
</data>
</openerp>

View File

@ -1,8 +1,9 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_idea_category","idea.category","model_idea_category","base.group_user",1,0,0,0
"access_idea_idea","idea.idea","model_idea_idea","base.group_user",1,1,1,1
"access_idea_comment","idea.comment","model_idea_comment","base.group_user",1,1,1,1
"access_idea_vote","idea.vote","model_idea_vote","base.group_user",1,1,1,1
"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
"idea_post_vote","idea.post.vote","model_idea_post_vote","base.group_user",1,1,1,1
"access_idea_select","idea.select","model_idea_select","base.group_user",1,1,1,1
"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_idea_category idea.category model_idea_category base.group_user 1 0 0 0
3 access_idea_idea idea.idea model_idea_idea base.group_user 1 1 1 1
access_idea_comment idea.comment model_idea_comment base.group_user 1 1 1 1
4 access_idea_vote idea.vote model_idea_vote base.group_user 1 1 1 1
5 access_idea_vote_stat idea.vote.stat model_idea_vote_stat base.group_user 1 0 0 0
6 access_idea_category_system idea.category system model_idea_category base.group_system 1 1 1 1
7 idea_post_vote idea.post.vote model_idea_post_vote base.group_user 1 1 1 1
8 access_idea_select idea.select model_idea_select base.group_user 1 1 1 1
9 access_idea_comment idea.comment model_idea_comment base.group_system 1 1 1 1

View File

@ -8,10 +8,10 @@
name: Technical
- |
I create a New Idea of "Technical presentation for 1 hours in every day" and specify category "Technical".
-
!record {model: idea.idea, id: idea_idea_0}:
category_id: idea_category_technical0
created_date: '05/13/2010 19:16:26'
description: I want that Technical presentation are arranged for 1 hours in every
day.\nso, on that presentation, we can know all things what improvement and development
are done in our company.\n\n\n\n\n
@ -44,52 +44,50 @@
!record {model: res.users, id: res_users_user1}:
company_id: base.main_company
context_lang: en_US
groups_id:
- base.group_system
- base.group_user
login: user2
name: user2
password: user2
- |
In order to post vote I connect as user1 and open the idea page
I click on "Vote" wizard and vote the idea as "Normal"
I click on "Submit Vote" wizard button and vote the idea as "Normal"
-
!record {model: idea.post.vote, id: idea_post_vote_0}:
vote: 50
- |
Now I click on "Post Vote" button of wizard.
Now I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
uid = ref('res_users_user0')
self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_id': ref('idea_idea_0')})
self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]})
- |
To add other vote I connect as user2 and open the idea page
I click on "Vote" wizard and vote the idea as "Very Good"
To add other vote I connect as user2 and open the idea page.
I click on "Submit Vote" wizard button and vote the idea as "Very Good".
and put comment "We can learn many things from technical presentation".
-
!record {model: idea.post.vote, id: idea_post_vote_1}:
vote: 100
note: 'We can learn many things from technical presentation'
- |
I click on "Post Vote" button of this wizard.
I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
uid = ref('res_users_user1')
self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_id': ref('idea_idea_0')})
self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]})
- |
I can see that the Average score changed in "Average score" field with value 75
-
!record {model: idea.idea, id: idea_idea_0}:
vote_avg: 75
- |
I put one comment "We can learn many things from technical presentation" for the idea.
-
!record {model: idea.idea, id: idea.idea_idea_0}:
comment_ids:
- content: "We can learn many things from technical presentation"
idea_id: idea.idea_idea_0
user_id: res_users_user1
- |
I connect as Manager and close this idea by click on "Close" button.

View File

@ -70,15 +70,28 @@ class idea_post_vote(osv.osv_memory):
@param context: A standard dictionary for contextual values
"""
idea_obj = self.pool.get('idea.idea')
vote_obj = self.pool.get('idea.vote')
for idea in idea_obj.browse(cr, uid, context.get('active_ids', [])):
if idea.state in ['draft', 'close', 'cancel']:
raise osv.except_osv(_("Warning !"), _("Draft/Accepted/Cancelled ideas Could not be voted"))
for active_id in context.get('active_ids'):
vote_ids = vote_obj.search(cr, uid, [('user_id', '=', uid), ('idea_id', '=', active_id)])
vote_obj_id = vote_obj.browse(cr, uid, vote_ids)
count = 0
for vote in vote_obj_id:
count += 1
user_limit = idea.vote_limit
if count >= user_limit:
raise osv.except_osv(_('Warning !'),_("You can not give Vote for this idea more than %s times") % (user_limit))
if idea.state != 'open':
raise osv.except_osv(_('Warning !'), _('idea should be in \'Open\' state before vote for that idea.'))
raise osv.except_osv(_('Warning !'), _('Idea should be in \
\'Open\' state before vote for that idea.'))
return False
def do_vote(self, cr, uid, ids, context):
def do_vote(self, cr, uid, ids, context=None):
"""
Create idea vote.
@param cr: the current row, from the database cursor,
@ -87,30 +100,72 @@ class idea_post_vote(osv.osv_memory):
@return: Dictionary {}
"""
vote_id = context and context.get('active_id', False) or False
vote_ids = context and context.get('active_ids', []) or []
vote_pool = self.pool.get('idea.vote')
comment_pool = self.pool.get('idea.comment')
for do_vote_obj in self.read(cr, uid, ids):
score = str(do_vote_obj['vote'])
comment = do_vote_obj.get('note', False)
vote = {
'idea_id': vote_id,
'user_id': uid,
'score': score
}
if comment:
comment = {
'user_id':uid,
'idea_id':vote_id,
'content': comment,
}
comment = comment_pool.create(cr, uid, comment)
for vote_id in vote_ids:
vote = vote_pool.create(cr, uid, vote)
vote = {
'idea_id': vote_id,
'user_id': uid,
'score': score
}
if comment:
comment = {
'user_id':uid,
'idea_id':vote_id,
'content': comment,
}
comment = comment_pool.create(cr, uid, comment)
vote = vote_pool.create(cr, uid, vote)
return {}
idea_post_vote()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
class idea_select(osv.osv_memory):
""" Select idea for vote."""
_name = "idea.select"
_description = "select idea"
_columns = {
'idea_id': fields.many2one('idea.idea', 'Idea', required=True),
}
def open_vote(self, cr, uid, ids, context=None):
"""
This function load column.
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of load column,
@return: dictionary of query logs clear message window
"""
idea_obj = self.browse(cr, uid, ids)
for idea in idea_obj:
idea_id = idea.idea_id.id
data_obj = self.pool.get('ir.model.data')
id2 = data_obj._get_id(cr, uid, 'idea', 'view_idea_post_vote')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
value = {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'idea.post.vote',
'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
'type': 'ir.actions.act_window',
'target': 'new',
'context': {'active_ids': [idea_id]}
}
return value
idea_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Post Idea for vote Form View -->
<record id="view_idea_post_vote" model="ir.ui.view">
@ -9,7 +8,7 @@
<field name="model">idea.post.vote</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Create Tasks">
<form string="Give Vote">
<group colspan="4" >
<field name="vote" colspan="4"/>
<separator string="Comment" colspan="4"/>
@ -18,12 +17,33 @@
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-ok" name="do_vote" string="Post Vote" type="object"/>
<button icon="gtk-ok" name="do_vote" string="Post" type="object"/>
</group>
</form>
</field>
</record>
<record id="view_idea_select" model="ir.ui.view">
<field name="name">idea.select.form</field>
<field name="model">idea.select</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Idea for Vote">
<group colspan="4" >
<separator string="Select Idea for Vote" colspan="4"/>
<field name="idea_id"/>
</group>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<label string="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Close"/>
<button icon="gtk-go-forward" name="open_vote" string="Next" type="object"/>
</group>
</form>
</field>
</record>
<!-- Post Idea for vote Action -->
<record id="action_idea_post_vote" model="ir.actions.act_window">
@ -33,7 +53,17 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_idea_post_vote"/>
<field name="target">new</field>
</record>
</record>
<record id="action_idea_select" model="ir.actions.act_window">
<field name="name">Idea select</field>
<field name="res_model">idea.select</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_idea_select"/>
<field name="target">new</field>
<field name="context">{'model': 'idea.idea'}</field>
</record>
</data>
</openerp>

View File

@ -24,18 +24,15 @@
'version': '1.0',
'category': 'Generic Modules/Mail Service',
'description': """The generic email gateway system allows to send and receive emails
* IMAP / IMAP with SSL
* POP / POP with SSL
* SMTP / SMTP with TLS
* ACL based access policy
* Queueing and History for Emails
* History for Emails
* Easy Integration with any Module""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base'],
'init_xml': [],
'update_xml': [
"mail_gateway_view.xml"
"mail_gateway_view.xml",
'security/ir.model.access.csv'
],
'demo_xml': [],
'installable': True,

View File

@ -21,6 +21,7 @@
from osv import osv, fields
import time
import base64
class one2many_domain(fields.one2many):
def set(self, cr, obj, id, field, values, user=None, context=None):
@ -49,12 +50,12 @@ class mailgate_thread(osv.osv):
_rec_name = 'thread'
_columns = {
'thread': fields.char('Thread', size=32, required=False),
'thread': fields.char('Thread', size=32, required=False),
'message_ids': one2many_domain('mailgate.message', 'thread_id', 'Messages', domain=[('history', '=', True)], required=False),
'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
'log_ids': one2many_domain('mailgate.message', 'thread_id', 'Logs', domain=[('history', '=', False)], required=False),
}
def __history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
def __history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, email_from=False, message_id=False, attach=[], context={}):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@ -64,6 +65,7 @@ class mailgate_thread(osv.osv):
@param history: Value True/False, If True it makes entry in case History otherwise in Case Log
@param email: Email address if any
@param details: Details of case history if any
@param atach: Attachment sent in email
@param context: A standard dictionary for contextual values"""
if context is None:
context = {}
@ -72,28 +74,43 @@ class mailgate_thread(osv.osv):
cases = self.pool.get(context['model']).browse(cr, uid, cases, context=context)
model_obj = self.pool.get('ir.model')
att_obj = self.pool.get('ir.attachment')
obj = self.pool.get('mailgate.message')
for case in cases:
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
data = {
'name': keyword,
'user_id': uid,
'model_id' : model_ids and model_ids[0] or False,
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'thread_id': case.thread_id.id,
'message_id': message_id
'name': keyword,
'user_id': uid,
'model_id' : model_ids and model_ids[0] or False,
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'thread_id': case.thread_id.id,
'message_id': message_id,
}
attachments = []
if history:
data['history'] = True
data['description'] = details or case.description
data['email_to'] = email or \
(case.user_id and case.user_id.address_id and \
case.user_id.address_id.email) or tools.config.get('email_from', False)
data['email_from'] = email_from or \
(case.user_id and case.user_id.address_id and \
case.user_id.address_id.email) or tools.config.get('email_from', False)
for att in attach:
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
data = {
'name': subject or 'History',
'history': True,
'user_id': uid,
'model_id' : model_ids and model_ids[0] or False,
'res_id': case.id,
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'description': details or (hasattr(case, 'description') and case.description or False),
'email_to': email or \
(hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
case.user_id.address_id.email) or tools.config.get('email_from', False),
'email_from': email_from or \
(hasattr(case, 'user_id') and case.user_id and case.user_id.address_id and \
case.user_id.address_id.email) or tools.config.get('email_from', False),
'partner_id': hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False,
'thread_id': case.thread_id.id,
'message_id': message_id,
'attachment_ids': [(6, 0, attachments)]
}
res = obj.create(cr, uid, data, context)
return True
@ -112,20 +129,22 @@ class mailgate_message(osv.osv):
_order = 'date desc'
_columns = {
'name':fields.char('Message', size=64),
'model_id': fields.many2one('ir.model', 'Model'),
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
'date': fields.datetime('Date'),
'name':fields.char('Message', size=64),
'model_id': fields.many2one('ir.model', 'Model'),
'res_id': fields.integer('Resource ID'),
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
'date': fields.datetime('Date'),
'history': fields.boolean('Is History?', required=False),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
'message': fields.text('Description'),
'email_from': fields.char('Email From', size=84),
'email_to': fields.char('Email To', size=84),
'email_cc': fields.char('Email From', size=84),
'email_bcc': fields.char('Email From', size=84),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
'message': fields.text('Description'),
'email_from': fields.char('Email From', size=84),
'email_to': fields.char('Email To', size=84),
'email_cc': fields.char('Email CC', size=84),
'email_bcc': fields.char('Email BCC', size=84),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
'description': fields.text('Description'),
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
'partner_id': fields.many2one('res.partner', 'Partner', required=False),
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
}
mailgate_message()

View File

@ -1,48 +1,66 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_maligate_message_form">
<field name="name">maligate.message.form</field>
<field name="model">maligate.message</field>
<record model="ir.ui.view" id="view_mailgate_message_form">
<field name="name">mailgate.message.form</field>
<field name="model">mailgate.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="maligate message">
<field name="name" />
<field name="date" />
<field name="user_id" />
<field name="history" />
<field name="message_id" />
<form string="mailgate message">
<group colspan="4" col="6">
<field name="name" required="1" select="1"/>
<field name="date" required="1" select="1"/>
<field name="user_id" string="Responsible" select="1"/>
</group>
<notebook colspan="4">
<page>
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
</group>
</page>
<page>
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" />
</page>
</notebook>
<page string="Details">
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
<field name="message_id" />
</group>
<separator string="Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4" />
</page>
<page string="Attachments">
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" readonly="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_message_tree">
<field name="name">maligate.message.tree</field>
<field name="model">maligate.message</field>
<field name="name">mailgate.message.tree</field>
<field name="model">mailgate.message</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Mailgateway Message">
<field name="name" select="1" />
<field name="date" />
<field name="email_from" />
<field name="user_id" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_message_search">
<field name="name">mailgate.message.search</field>
<field name="model">mailgate.message</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Mailgateway Message Search">
<field name="name" />
<field name="date" />
<field name="user_id" />
<field name="message_id" />
</search>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_thread_form">
<field name="name">mailgate.thread.form</field>
@ -53,32 +71,33 @@
<field name="thread" select="1"/>
<separator string="Logs" colspan="4"/>
<field name="log_ids" nolabel="1" colspan="4" domain="[('history', '=', True)]">
<tree string="Mailgateway Logs">
<field name="name" select="1" />
<field name="date" />
</tree>
<form string="Maligate Logs">
<field name="name" />
<field name="date" />
<field name="user_id" />
<field name="message_id" />
<field name="history" />
<notebook colspan="4">
<page string="Email Details">
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
</group>
</page>
<page string="Attachments">
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" />
</page>
</notebook>
</form>
<tree string="Mailgateway Logs">
<field name="name" select="1" />
<field name="date" />
</tree>
<form string="Mailgate Logs">
<field name="name" />
<field name="date" />
<field name="user_id" />
<field name="message_id" />
<notebook colspan="4">
<page string="Email Details">
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
</group>
<separator string="Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4" />
</page>
<page string="Attachments">
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" />
</page>
</notebook>
</form>
</field>
<separator string="Histories" colspan="4"/>
<field name="message_ids" nolabel="1" colspan="4" domain="[('history', '=', True)]">
@ -86,7 +105,7 @@
<field name="name" select="1" />
<field name="date" />
</tree>
<form string="Maligate Histories">
<form string="Mailgate Histories">
<field name="name" />
<field name="date" />
<field name="user_id" />
@ -126,29 +145,39 @@
</record>
<record model="ir.actions.act_window" id="action_view_mailgate_thread">
<field name="name">Mailgateway Threads</field>
<field name="res_model">mailgate.thread</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
</record>
<field name="name">Mailgateway Threads</field>
<field name="res_model">mailgate.thread</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_mailgate_thread_form"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_mailgate_thread_form"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<menuitem id="menu_mailgate_thread" name="Mailgateway Threads" action="action_view_mailgate_thread"
parent="base.menu_base_config" sequence="100"/>
-->
<!-- <menuitem id="base.menu_crm_configuration" name="Cases"
parent="base.menu_base_config" sequence="0"/>
<menuitem id="menu_mailgate_thread" name="Mailgateway Threads" action="action_view_mailgate_thread"
parent="base.menu_crm_configuration" sequence="20"/>
-->
<act_window domain="[('partner_id', '=', active_id), ('history', '=', True)]"
id="act_res_partner_emails" name="Emails"
res_model="mailgate.message"
src_model="res.partner"
view_id="view_mailgate_message_tree"
/>
</data>
</openerp>
</openerp>

View File

@ -446,9 +446,9 @@ class product_product(osv.osv):
'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'),
'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')),
'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='List Price', digits_compute=dp.get_precision('Sale Price')),
'code': fields.function(_product_code, method=True, type='char', string='Code'),
'code': fields.function(_product_code, method=True, type='char', string='Reference'),
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
'default_code' : fields.char('Code', size=64),
'default_code' : fields.char('Reference', size=64),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=False),
@ -676,7 +676,20 @@ class pricelist_partnerinfo(osv.osv):
_order = 'min_quantity asc'
pricelist_partnerinfo()
class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
def create(self, cr, uid, data, context={}):
user_id = super(res_users, self).create(cr, uid, data, context)
data_obj = self.pool.get('ir.model.data')
data_id = data_obj._get_id(cr, uid, 'product', 'ir_ui_view_sc_product0')
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
'user_id': user_id}, context=context)
return user_id
res_users()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -21,32 +21,27 @@
<field name="category_id" ref="product_uom_categ_unit"/>
<field name="name">PCE</field>
<field name="factor">1.0</field>
<field name="factor_inv_data">1.0</field>
<field name="rounding">1.0</field>
</record>
<record id="product_uom_kgm" model="product.uom">
<field name="category_id" ref="product_uom_categ_kgm"/>
<field name="name">KGM</field>
<field name="factor">1000.0</field>
<field name="factor_inv_data">1.0</field>
</record>
<record id="uom_hour" model="product.uom">
<field name="name">Hour</field>
<field eval="uom_categ_wtime" name="category_id"/>
<field name="factor">8.0</field>
<field name="factor_inv_data">1.0</field>
</record>
<record id="uom_day" model="product.uom">
<field name="name">Day</field>
<field eval="uom_categ_wtime" name="category_id"/>
<field name="factor">1.0</field>
<field name="factor_inv_data">1.0</field>
</record>
<record id="product_uom_ton" model="product.uom">
<field name="category_id" ref="product_uom_categ_kgm"/>
<field name="name">TON</field>
<field name="factor">1.0</field>
<field name="factor_inv_data">1.0</field>
</record>
<!--

View File

@ -99,7 +99,7 @@
<group colspan="2" col="2" name="status">
<separator string="Status" colspan="2"/>
<field name="categ_id"/>
<field name="categ_id" select="1" groups="base.group_extended"/>
<field name="state"/>
<field groups="base.group_extended" name="product_manager"/>
</group>

View File

@ -117,20 +117,27 @@
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'project.issue'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</group>
<notebook colspan="4">
<page string="Details">
<field name="description" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'project.issue'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="date"/>
<field name="email_from" />
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
<button colspan="4" string="Send New Email"
name="%(crm.action_crm_send_mail)d"

View File

@ -261,12 +261,10 @@ class purchase_order(osv.osv):
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
return True
#TODO: implement messages system
def wkf_confirm_order(self, cr, uid, ids, context={}):
todo = []
for po in self.browse(cr, uid, ids):
if self.pool.get('res.partner.event.type').check(cr, uid, 'purchase_open'):
self.pool.get('res.partner.event').create(cr, uid, {'name':'Purchase Order: '+po.name, 'partner_id':po.partner_id.id, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'user_id':uid, 'partner_type':'retailer', 'probability': 1.0, 'planned_cost':po.amount_untaxed})
if not po.order_line:
raise osv.except_osv(_('Error !'),_('You can not confirm purchase order without Purchase Order Lines.'))
for line in po.order_line:

View File

@ -7,11 +7,6 @@
<field name="object">purchase.order</field>
</record>
<record id="event_type_purchase_open" model="res.partner.event.type">
<field name="name">Purchase: Purchase Confirmation</field>
<field name="key">purchase_open</field>
</record>
<record id="pricelist_type_purchase" model="product.pricelist.type">
<field name="name">Purchase Pricelist</field>
<field name="key">purchase</field>

View File

@ -49,7 +49,6 @@ def _incoterm_get(self, cr, uid, context=None):
cr.execute('select code, code||\', \'||name from stock_incoterms where active')
return cr.fetchall()
class sale_order(osv.osv):
_name = "sale.order"
_log_create = True

View File

@ -9,16 +9,6 @@
<field name="object">sale.order</field>
</record>
<!--
Partner event type
-->
<record id="event_type_sale_open" model="res.partner.event.type">
<field name="name">SALE: Sale Confirmation</field>
<field name="key">sale_open</field>
</record>
<!--
Resource: sale.shop
-->

View File

@ -193,6 +193,7 @@
<field name="amount_tax"/>
<field name="amount_total"/>
<button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
<button name="%(action_view_sale_advance_payment_inv)d" string="Advance Invoice" type="action" icon="gtk-execute"/>
</group>
<group col="13" colspan="4">
<field name="state"/>
@ -385,6 +386,11 @@
<field colspan="4" name="tax_id" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]" nolabel="1"/>
<separator colspan="4" string="States"/>
<field name="state"/>
<button colspan="1"
name="%(action_view_sale_order_line_make_invoice)d"
string="Make Invoice"
type="action"
icon="gtk-print" />
<group col="2" colspan="2">
<button name="button_done"
states="confirmed,exception"

View File

@ -14,13 +14,14 @@
</field>
</record>
<act_window name="Make Invoices"
res_model="sale.order.line.make.invoice"
src_model="sale.order.line"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_view_sale_order_line_make_invoice"/>
<record id="action_view_sale_order_line_make_invoice" model="ir.actions.act_window">
<field name="name">Make Invoices</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line.make.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -9,7 +9,7 @@
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="priority" position="after">
<button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
<button string="Create a Sale Order" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
<label colspan="2" string=""/>
</field>
</field>

View File

@ -28,7 +28,7 @@ import pooler
from tools.translate import _
sale_form = """<?xml version="1.0"?>
<form string="Convert to Quote">
<form string="Create a Sale Order">
<field name="partner_id" required="True"/>
<field name="shop_id" required="True"/>
<field name="analytic_account"/>
@ -135,10 +135,10 @@ class make_sale(wizard.interface):
if data['form']['close']:
case_obj.case_close(cr, uid, data['ids'])
if not new_ids:
return {}
if len(new_ids)<=1:
value = {
'domain': str([('id', 'in', new_ids)]),
@ -159,7 +159,7 @@ class make_sale(wizard.interface):
'type': 'ir.actions.act_window',
'res_id':new_ids
}
return value
states = {

View File

@ -18,10 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import sale_journal
import sale_journal_inherit
import sale_journal_report
import sale_journal_picking_report
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,7 +28,7 @@
The sale journal modules allows you to categorise your
sales and deliveries (picking lists) between different journals.
This module is very helpful for bigger companies that
work by departments.
works by departments.
You can use journal for different purposes, some examples:
* isolate sales of different departments
@ -54,8 +54,7 @@
'update_xml': [
'security/ir.model.access.csv',
'sale_journal_view.xml',
'picking_journal_view.xml',
'picking_journal_view_report.xml'
'report/sale_journal_report_view.xml',
],
'demo_xml': ['sale_journal_demo.xml'],
'installable': True,

View File

@ -1,110 +0,0 @@
<openerp>
<data>
<record model="ir.ui.view" id="view_picking_journal_form">
<field name="name">sale_journal.picking.journal.form</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Picking Journal">
<notebook>
<page string="Journal">
<separator string="Journal Information" colspan="4"/>
<field name="name"/>
<field name="code"/>
<field name="user_id"/>
<field name="date"/>
<field name="date_created"/>
<field name="date_validation"/>
<separator string="States" colspan="4"/>
<field name="state"/>
<group col="3" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
</group>
</page>
<page string="Picking">
<button string="Cancel Picking" name="button_picking_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
<newline/>
<field name="picking_stats_ids" colspan="4" nolabel="1"/>
</page><page string="Notes">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_picking_journal_tree">
<field name="name">sale_journal.picking.journal.tree</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking Journal">
<field name="name"/>
<field name="code"/>
<field name="user_id"/>
<field name="date"/>
<field name="state"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_picking_journal_search">
<field name="name">sale_journal.picking.journal.search</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking Journal">
<group col="8" colspan="4">
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Picking Journals"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="code"/>
<field name="user_id" widget="selection"/>
<field name="date"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_definition_picking_journal">
<field name="name">Picking journals</field>
<field name="res_model">sale_journal.picking.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_picking_journal_search"/>
</record>
<menuitem name="Picking Journals" id="menu_definition_journal_picking" parent="stock.menu_stock_configuration" action="action_definition_picking_journal"/>
<record model="ir.actions.act_window" id="action_invoice_type_tree">
<field name="name">Picking by invoice_method</field>
<field name="name">sale_journal.invoice.type.tree</field>
<field name="res_model">sale_journal.invoice.type</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">tree</field>
</record>
<!--<menuitem name="Picking to Invoice" id="menu_definition_journal_picking_invoice" parent="stock.menu_action_picking_tree"/>-->
<!--<menuitem name="Picking by Invoice Method" id="menu_definition_journal_picking_invoice_method" parent="menu_definition_journal_picking_invoice" action="action_invoice_type_tree"/>-->
<record model="ir.actions.act_window" id="action_invoice_type_picking_open">
<field name="name">Picking to invoice</field>
<field name="res_model">stock.picking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
</record>
<record model="ir.values" id="ir_open_invoice_type">
<field name="key2">tree_but_open</field>
<field name="model">sale_journal.invoice.type</field>
<field name="name">Picking to invoice</field>
<field name="value" eval="'ir.actions.act_window,%d'%action_invoice_type_picking_open"/>
<field name="object" eval="True"/>
</record>
</data>
</openerp>

View File

@ -1,151 +0,0 @@
<openerp>
<data>
#
# Pickings by invoice type
#
<record model="ir.ui.view" id="view_picking_invoice_type_stats_form">
<field name="name">sale_journal.invoice.type.stats.form</field>
<field name="model">sale_journal.invoice.type.stats</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Picking by invoice method">
<field name="name"/>
<field name="month"/>
<field name="invoice_state"/>
<field name="state"/>
<field name="invoice_type_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_picking_invoice_type_stats_tree">
<field name="name">sale_journal.invoice.type.stats.tree</field>
<field name="model">sale_journal.invoice.type.stats</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking by invoice method">
<field name="name"/>
<field name="month"/>
<field name="invoice_state"/>
<field name="state"/>
<field name="invoice_type_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_picking_invoice_type_stats_search">
<field name="name">sale_journal.invoice.type.stats.search</field>
<field name="model">sale_journal.invoice.type.stats</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking by invoice method">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by invoice method in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by invoice method in this month"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="month"/>
<field name="invoice_state"/>
<field name="state"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open">
<field name="name">Statistics on picking to invoice</field>
<field name="res_model">sale_journal.invoice.type.stats</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
</record>
<menuitem name="Picking Journal" id="menu_definition_journal_reporting" parent="stock.next_id_61"/>
<record model="ir.actions.act_window" id="action_invoice_type_picking_stats_open_menu_all">
<field name="name">Picking by invoice method</field>
<field name="res_model">sale_journal.invoice.type.stats</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_picking_invoice_type_stats_search"/>
</record>
<menuitem name="Picking by Invoice Method" id="menu_invoice_type_picking_stats_open_all" parent="menu_definition_journal_reporting" action="action_invoice_type_picking_stats_open_menu_all"/>
#
# Packing by journal
#
<record model="ir.ui.view" id="view_picking_journal_stats_form">
<field name="name">sale_journal.picking.stats.form</field>
<field name="model">sale_journal.picking.stats</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Picking by journals">
<field name="name"/>
<field name="month"/>
<field name="state"/>
<field name="journal_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_picking_journal_stats_tree">
<field name="name">sale_journal.picking.stats.tree</field>
<field name="model">sale_journal.picking.stats</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking by journals">
<field name="name"/>
<field name="state"/>
<field name="journal_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_picking_journal_stats_search">
<field name="name">sale_journal.picking.stats.search</field>
<field name="model">sale_journal.picking.stats</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking by journals">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by journals in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by journals in this month"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="month"/>
<field name="state"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_picking_picking_stats_open_menu_all">
<field name="name">Picking by journal</field>
<field name="res_model">sale_journal.picking.stats</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_picking_journal_stats_search"/>
</record>
<menuitem name="Picking by Journal" id="menu_picking_picking_stats_open_all" parent="menu_definition_journal_reporting" action="action_picking_picking_stats_open_menu_all"/>
</data>
</openerp>

View File

@ -0,0 +1,24 @@
# -*- 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 sale_journal_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,141 @@
# -*- 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 fields, osv
import tools
class sale_journal_report(osv.osv):
_name = "sale.journal.report"
_description = "Sales Orders by Journal"
_auto = False
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'month':fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'),
('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'),
('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'state': fields.selection([
('draft', 'Quotation'),
('waiting_date', 'Waiting Schedule'),
('manual', 'Manual in progress'),
('progress', 'In progress'),
('shipping_except', 'Shipping Exception'),
('invoice_except', 'Invoice Exception'),
('done', 'Done'),
('cancel', 'Cancel')
], 'Order State', readonly=True),
'journal_id':fields.many2one('sale_journal.sale.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', readonly=True),
}
_order = 'journal_id, name desc,price_total desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_report')
cr.execute("""
create or replace view sale_journal_report as (
select
min(l.id) as id,
to_char(s.date_order, 'YYYY') as name,
to_char(s.date_order,'MM') as month,
s.state,
s.journal_id,
sum(l.product_uom_qty) as quantity,
count(*),
sum(l.product_uom_qty*l.price_unit) as price_total,
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty))::decimal(16,2) as price_average
from sale_order s
right join sale_order_line l on (s.id=l.order_id)
group by s.journal_id , to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'), s.state
)
""")
sale_journal_report()
#==========================================
#picking report
#==========================================
class sale_journal_picking_report(osv.osv):
"""
Picking list by journal and by invoice
"""
_name = "sale.journal.picking.report"
_description = "Picking lists"
_auto = False
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'month':fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'invoice_state':fields.selection([
("invoiced", "invoiced"),
("2binvoiced", "to be invoiced"),
("none", "None")
], "Invoice state", readonly=True),
'state': fields.selection([
('draft', 'draft'),
('auto', 'waiting'),
('confirmed', 'confirmed'),
('assigned', 'assigned'),
('done', 'done'),
('cancel', 'cancel'),
], 'State', readonly=True),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
'journal_id':fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', readonly=True),
}
_order = 'journal_id, name desc, price_total desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_picking_report')
cr.execute("""
create or replace view sale_journal_picking_report as (
select
min(l.id) as id,
to_char(s.date, 'YYYY') as name,
to_char(s.date, 'MM') as month,
s.state,
s.invoice_state,
s.invoice_type_id,
s.journal_id,
sum(l.product_qty) as quantity,
count(*) as count,
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
from stock_picking s
right join stock_move l on (s.id=l.picking_id)
left join sale_order_line ol on (l.sale_line_id=ol.id)
group by s.journal_id, s.invoice_type_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state, s.invoice_state
order by s.invoice_type_id, s.invoice_state, s.state
)
""")
sale_journal_picking_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,187 @@
<openerp>
<data>
<!-- Sales by journal's view -->
<record model="ir.ui.view" id="view_sale_journal_report_tree">
<field name="name">sale.journal.report.tree</field>
<field name="model">sale.journal.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sales by Journal">
<field name="name" invisible="1"/>
<field name="state" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_average"/>
<field name="price_total"/>
</tree>
</field>
</record>
<!-- sales journal graph view -->
<record id="view_sale_journal_graph" model="ir.ui.view">
<field name="name">sale.journal.report.graph</field>
<field name="model">sale.journal.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Sales journal Statistics" type="bar">
<field name="journal_id"/>
<field name="price_total"/>
</graph>
</field>
</record>
<!-- sales by journal search view -->
<record model="ir.ui.view" id="view_sale_journal_report_search">
<field name="name">sale.journal.report.search</field>
<field name="model">sale.journal.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Sales by Journal">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','!=','')]" help="Sale journal in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('name','=',time.strftime('%%Y-%%m-01'))]" help="Sale journal in this month"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new"
string="Quotations"
domain="[('state','=','draft')]"/>
<filter icon="terp-gtk-media-pause"
string="Waiting Schedule"
domain="[('state','=','waiting_date')]"/>
<filter icon="terp-camera_test"
string="In progress"
domain="[('state','=','progress')]"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="state" select="1"/>
<field name="journal_id" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="12">
<filter string="journal" name="journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<!-- Action of sales by journal view-->
<record model="ir.actions.act_window" id="action_sale_journal_report_open_menu_all">
<field name="name">Sales by Journal</field>
<field name="res_model">sale.journal.report</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_sale_journal_report_search"/>
<field name="context">{'search_default_journal': 1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem name="Sales by Journal" id="menu_sale_journal_report_open_all" parent="base.next_id_64" action="action_sale_journal_report_open_menu_all"/>
<!-- picking by journal and invoice's tree view-->
<record model="ir.ui.view" id="view_sale_journal_picking_report_tree">
<field name="name">sale.journal.picking.report.tree</field>
<field name="model">sale.journal.picking.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking Journal">
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="invoice_state" invisible="1"/>
<field name="state" invisible="1"/>
<field name="invoice_type_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="quantity" />
<field name="count" />
<field name="price_average"/>
<field name="price_total"/>
</tree>
</field>
</record>
<!-- picking journal's graph view -->
<record id="view_sale_journal_picking_graph" model="ir.ui.view">
<field name="name">sale.journal.picking.report.graph</field>
<field name="model">sale.journal.picking.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Picking journal Statistics" type="bar">
<field name="journal_id"/>
<field name="invoice_type_id"/>
<field name="price_total"/>
</graph>
</field>
</record>
<!-- Picking journal search view -->
<record model="ir.ui.view" id="view_sale_journal_picking_report_search">
<field name="name">sale.journal.picking.report.search</field>
<field name="model">sale.journal.picking.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking journal">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" name="year" domain="[('name','=',time.strftime('%%Y'))]" help="Picking by invoice or by journal method in this year"/>
<filter icon="terp-go-month" string="This Month" name="month" domain="[('month','=',time.strftime('%%m'))]" help="Picking by invoice or by journal method in this month"/>
<separator orientation="vertical"/>
<filter icon="terp-document-new"
string="Draft"
domain="[('state','=','draft')]"/>
<filter icon="terp-gtk-media-pause"
string="Pending"
domain="[('state','=','waiting')]"/>
<filter icon="terp-camera_test"
string="Confirmed"
domain="[('state','=','confirmed')]"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="month" select="1"/>
<field name="invoice_state" select="1"/>
<field name="state" select="1"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="12">
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
<filter string="Invoice" icon="terp-dolar" context="{'group_by':'invoice_type_id'}"/>
<separator orientation="vertical"/>
<filter string="Invoice state" icon="terp-stock_effects-object-colorize" context="{'group_by':'invoice_state'}"/>
<filter string="state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_sale_journal_picking_report_open">
<field name="name">Statistics on picking to invoice</field>
<field name="res_model">sale.journal.picking.report</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
</record>
<!-- Action for picking journal view -->
<record model="ir.actions.act_window" id="action_sale_journal_picking_report_open_menu_all">
<field name="name">Picking Journal</field>
<field name="res_model">sale.journal.picking.report</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_sale_journal_picking_report_search"/>
<field name="context">{'search_default_month':1, 'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem name="Picking journal" id="menu_invoice_type_picking_stats_open_all" parent="stock.next_id_61" action="action_sale_journal_picking_report_open_menu_all"/>
</data>
</openerp>

View File

@ -25,7 +25,7 @@ import time
class sale_journal_invoice_type(osv.osv):
_name = 'sale_journal.invoice.type'
_description = 'Invoice Type'
_description = 'Invoice Types'
_columns = {
'name': fields.char('Invoice Type', size=64, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the invoice type without removing it."),
@ -48,12 +48,12 @@ class sale_journal(osv.osv):
'date': fields.date('Journal date', required=True),
'date_created': fields.date('Creation date', readonly=True, required=True),
'date_validation': fields.date('Validation date', readonly=True),
'sale_stats_ids': fields.one2many("sale_journal.sale.stats", "journal_id", 'Sale Stats', readonly=True),
'sale_stats_ids': fields.one2many("sale.journal.report", "journal_id", 'Sale Stats', readonly=True),
'state': fields.selection([
('draft','Draft'),
('open','Open'),
('done','Done'),
], 'State', required=True),
], 'State', required=True, readonly=True),
'note': fields.text('Note'),
}
_defaults = {
@ -98,12 +98,12 @@ class picking_journal(osv.osv):
'date': fields.date('Journal date', required=True),
'date_created': fields.date('Creation date', readonly=True, required=True),
'date_validation': fields.date('Validation date', readonly=True),
'picking_stats_ids': fields.one2many("sale_journal.picking.stats", "journal_id", 'Journal Stats', readonly=True),
'picking_stats_ids': fields.one2many("sale.journal.picking.report", "journal_id", 'Journal Stats', readonly=True),
'state': fields.selection([
('draft','Draft'),
('open','Open'),
('done','Done'),
], 'Creation date', required=True),
], 'Creation date', required=True, readonly=True),
'note': fields.text('Note'),
}
_defaults = {
@ -130,5 +130,55 @@ class picking_journal(osv.osv):
return True
picking_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#==============================================
# sale journal inherit
#==============================================
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'property_invoice_type': fields.property(
'sale_journal.invoice.type',
type='many2one',
relation='sale_journal.invoice.type',
string="Invoicing Method",
method=True,
view_load=True,
group_name="Accounting Properties",
help="The type of journal used for sales and picking."),
}
res_partner()
class picking(osv.osv):
_inherit="stock.picking"
_columns = {
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal'),
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
}
picking()
class sale(osv.osv):
_inherit="sale.order"
_columns = {
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
}
def action_ship_create(self, cr, uid, ids, *args):
result = super(sale, self).action_ship_create(cr, uid, ids, *args)
for order in self.browse(cr, uid, ids, context={}):
pids = [ x.id for x in order.picking_ids]
self.pool.get('stock.picking').write(cr, uid, pids, {
'invoice_type_id': order.invoice_type_id.id,
'sale_journal_id': order.journal_id.id
})
return result
def onchange_partner_id(self, cr, uid, ids, part):
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
if part:
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
result['value']['invoice_type_id'] = itype
return result
sale()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,73 +0,0 @@
# -*- 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
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'property_invoice_type': fields.property(
'sale_journal.invoice.type',
type='many2one',
relation='sale_journal.invoice.type',
string="Invoicing Method",
method=True,
view_load=True,
group_name="Accounting Properties",
help="The type of journal used for sales and picking."),
}
res_partner()
class picking(osv.osv):
_inherit="stock.picking"
_columns = {
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal'),
'sale_journal_id': fields.many2one('sale_journal.sale.journal', 'Sale Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type', readonly=True)
}
picking()
class sale(osv.osv):
_inherit="sale.order"
_columns = {
'journal_id': fields.many2one('sale_journal.sale.journal', 'Journal'),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoice Type')
}
def action_ship_create(self, cr, uid, ids, *args):
result = super(sale, self).action_ship_create(cr, uid, ids, *args)
for order in self.browse(cr, uid, ids, context={}):
pids = [ x.id for x in order.picking_ids]
self.pool.get('stock.picking').write(cr, uid, pids, {
'invoice_type_id': order.invoice_type_id.id,
'sale_journal_id': order.journal_id.id
})
return result
def onchange_partner_id(self, cr, uid, ids, part):
result = super(sale, self).onchange_partner_id(cr, uid, ids, part)
if part:
itype = self.pool.get('res.partner').browse(cr, uid, part).property_invoice_type.id
result['value']['invoice_type_id'] = itype
return result
sale()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,124 +0,0 @@
# -*- 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 fields,osv
import tools
class report_sale_journal_invoice_type_stats(osv.osv):
_name = "sale_journal.invoice.type.stats"
_description = "Stats on picking by invoice method"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'invoice_state':fields.selection([
("invoiced","invoiced"),
("2binvoiced","to be invoiced"),
("none","None")
], "Invoice state", readonly=True),
'state': fields.selection([
('draft','draft'),
('auto','waiting'),
('confirmed','confirmed'),
('assigned','assigned'),
('done','done'),
('cancel','cancel'),
], 'State', readonly=True),
'invoice_type_id':fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'state,invoice_state,name desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_invoice_type_stats')
cr.execute("""
create or replace view sale_journal_invoice_type_stats as (
select
min(l.id) as id,
to_char(s.date, 'YYYY') as name,
to_char(s.date, 'MM') as month,
s.state,
s.invoice_state,
s.invoice_type_id,
sum(l.product_qty) as quantity,
count(*) as count,
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
from stock_picking s
left join stock_move l on (s.id=l.picking_id)
left join sale_order_line ol on (l.sale_line_id=ol.id)
group by s.invoice_type_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state, s.invoice_state
order by s.invoice_type_id, s.invoice_state, s.state
)
""")
report_sale_journal_invoice_type_stats()
class report_sale_journal_picking(osv.osv):
_name = "sale_journal.picking.stats"
_description = "Picking lists by Journal"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'state': fields.selection([
('draft','draft'),
('auto','waiting'),
('confirmed','confirmed'),
('assigned','assigned'),
('done','done'),
('cancel','cancel'),
], 'State', readonly=True),
'journal_id':fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'journal_id,name desc,price_total desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_picking_stats')
cr.execute("""
create or replace view sale_journal_picking_stats as (
select
min(l.id) as id,
to_char(s.date, 'YYYY') as name,
to_char(s.date, 'MM') as month,
s.state,
s.journal_id,
sum(l.product_qty) as quantity,
count(*) as count,
sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0)) as price_total,
(sum(l.product_qty*ol.price_unit*(1.0-ol.discount/100.0))/sum(l.product_qty))::decimal(16,2) as price_average
from stock_picking s
right join stock_move l on (s.id=l.picking_id)
right join sale_order_line ol on (l.sale_line_id=ol.id)
group by s.journal_id, to_char(s.date, 'YYYY'),to_char(s.date, 'MM'),s.state
)
""")
report_sale_journal_picking()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,73 +0,0 @@
# -*- 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 fields,osv
import tools
class report_sale_journal_sale(osv.osv):
_name = "sale_journal.sale.stats"
_description = "Sales Orders by Journal"
_auto = False
_columns = {
'name': fields.char('Year',size=64,required=False, readonly=True),
'state': fields.selection([
('draft','Quotation'),
('waiting_date','Waiting Schedule'),
('manual','Manual in progress'),
('progress','In progress'),
('shipping_except','Shipping Exception'),
('invoice_except','Invoice Exception'),
('done','Done'),
('cancel','Cancel')
], 'Order State', readonly=True),
'journal_id':fields.many2one('sale_journal.sale.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
'count': fields.integer('# of Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
}
_order = 'journal_id,name desc,price_total desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_sale_stats')
cr.execute("""
create or replace view sale_journal_sale_stats as (
select
min(l.id) as id,
to_char(s.date_order, 'YYYY') as name,
to_char(s.date_order,'MM') as month,
s.state,
s.journal_id,
sum(l.product_uom_qty) as quantity,
count(*),
sum(l.product_uom_qty*l.price_unit) as price_total,
(sum(l.product_uom_qty*l.price_unit)/sum(l.product_uom_qty))::decimal(16,2) as price_average
from sale_order s
right join sale_order_line l on (s.id=l.order_id)
group by s.journal_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
)
""")
report_sale_journal_sale()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,385 +1,469 @@
<openerp>
<data>
<record model="ir.ui.view" id="view_sale_journal_invoice_type_form">
<field name="name">sale_journal.invoice.type.form</field>
<field name="model">sale_journal.invoice.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Invoice Type">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="invoicing_method" select="1"/>
<newline/>
<field name="note" colspan="4"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_invoice_type_tree">
<field name="name">sale_journal.invoice.type.tree</field>
<field name="model">sale_journal.invoice.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Invoice Type">
<field name="name"/>
<field name="invoicing_method"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_definition_journal_invoice_type">
<field name="res_model">sale_journal.invoice.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<data>
<!-- <menuitem name="Invoicing Methods" id="menu_definition_journal_invoice_type" parent="sale.menu_shop_configuration" action="action_definition_journal_invoice_type"/>-->
<!-- sale journal invoice Type's Form view -->
<record model="ir.ui.view" id="view_sale_journal_form">
<field name="name">sale_journal.sale.journal.form</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sale Journal">
<notebook>
<page string="Journal">
<separator string="Journal Information" colspan="4"/>
<field name="name"/>
<field name="code"/>
<field name="user_id"/>
<field name="date"/>
<field name="date_created"/>
<field name="date_validation"/>
<separator string="States" colspan="4"/>
<field name="state"/>
<group col="3" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
</group>
</page>
<page string="Sales">
<button string="Confirm Sales" name="button_sale_confirm" states="draft,open" type="object" icon="gtk-execute"/>
<button string="Cancel Sales" name="button_sale_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
<newline/>
<field name="sale_stats_ids" colspan="4" nolabel="1">
<tree string="Sales">
<field name="name"/>
<field name="quantity"/>
<field name="price_total"/>
<field name="price_average"/>
<field name="count"/>
<field name="state"/>
</tree>
</field>
</page><page string="Notes">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_tree">
<field name="name">sale_journal.sale.journal.tree</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sale Journal">
<field name="name"/>
<field name="code"/>
<field name="user_id"/>
<field name="date"/>
<field name="state"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_invoice_type_form">
<field name="name">sale_journal.invoice.type.form</field>
<field name="model">sale_journal.invoice.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Invoice Type">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="invoicing_method" select="1"/>
<newline/>
<field name="note" colspan="4"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_search">
<field name="name">sale_journal.sale.journal.search</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Sales by Journal">
<group col="8" colspan="4">
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Sale Journals"/>
<separator orientation="vertical"/>
<!-- sale journal invoice Type's tree view -->
<record model="ir.ui.view" id="view_sale_journal_invoice_type_tree">
<field name="name">sale_journal.invoice.type.tree</field>
<field name="model">sale_journal.invoice.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Invoice Type">
<field name="name"/>
<field name="code"/>
<field name="user_id"/>
<field name="date" />
</group>
</search>
</field>
</record>
<field name="invoicing_method"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_definition_journal">
<field name="res_model">sale_journal.sale.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_sale_journal_search"/>
</record>
<!-- Action for sale journal invoice Type -->
<!-- <menuitem name="Sales Journals" id="menu_definition_journal" parent="sale.menu_shop_configuration" action="action_definition_journal"/>-->
<menuitem id="menu_sale_journal" name="Journal" parent="base.menu_base_config" sequence="60" />
<menuitem name="Sales Journals" id="menu_definition_journal" parent="menu_sale_journal" action="action_definition_journal"/>
<record model="ir.actions.act_window" id="action_definition_journal_invoice_type">
<field name="res_model">sale_journal.invoice.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record model="ir.ui.view" id="sale_journal_sale_order">
<field name="name">sale.order.journal.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="invoiced" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_sale_order_tree">
<field name="name">sale.order.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="invoice_type_id"/>
<field name="journal_id"/>
</field>
</field>
</record>
<!-- <menuitem name="Invoicing Methods" id="menu_definition_journal_invoice_type" parent="sale.menu_shop_configuration" action="action_definition_journal_invoice_type"/> -->
<record model="ir.ui.view" id="sale_journal_picking_order">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<!-- sale journal Form view -->
<record model="ir.ui.view" id="sale_journal_picking_order_tree">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree" />
<field name="arch" type="xml">
<field name="invoice_state" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_del">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_delivery_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_del">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_delivery_tree" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_in">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_in_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_in">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_in_tree" />
<field name="arch" type="xml">
<field name="invoice_state" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_out">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_out">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_tree" />
<field name="arch" type="xml">
<field name="invoice_state" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_sale_stats_tree">
<field name="name">sale_journal.sale.stats.tree</field>
<field name="model">sale_journal.sale.stats</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sales by Journal">
<field name="name"/>
<field name="state"/>
<field name="journal_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_sale_stats_form">
<field name="name">sale_journal.sale.stats.form</field>
<field name="model">sale_journal.sale.stats</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales by Journal">
<field name="name"/>
<field name="state"/>
<field name="journal_id"/>
<field name="quantity"/>
<field name="count"/>
<field name="price_total"/>
<field name="price_average"/>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_journal_sale_stats_search">
<field name="name">sale_journal.sale.stats.search</field>
<field name="model">sale_journal.sale.stats</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Sales by Journal">
<group col="8" colspan="4">
<filter icon="terp-go-year" string="This Year" domain="[('name','!=','')]" help="Sale journal in this year"/>
<filter icon="terp-go-month" string="This Month" domain="[('name','=',time.strftime('%%Y-%%m-01'))]" help="Sale journal in this month"/>
<separator orientation="vertical"/>
<field name="name"/>
<record model="ir.ui.view" id="view_sale_journal_form">
<field name="name">sale_journal.sale.journal.form</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Journals">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1"/>
<field name="date" select="1"/>
<field name="date_created" select="1"/>
<field name="date_validation" select="1"/>
</group>
<notebook colspan="4">
<page string="Sales">
<field name="sale_stats_ids" colspan="4" nolabel="1">
<tree string="Sales">
<field name="name"/>
<field name="quantity"/>
<field name="price_total"/>
<field name="price_average"/>
<field name="count"/>
<field name="state"/>
</tree>
</field>
</page>
<page string="Notes">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
<field name="state"/>
<group col="6" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
<button string="Confirm Sales" name="button_sale_confirm" states="draft,open" type="object" icon="gtk-execute"/>
<button string="Cancel Sales" name="button_sale_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
<!-- Sale journal tree view -->
<record model="ir.ui.view" id="view_sale_journal_tree">
<field name="name">sale_journal.sale.journal.tree</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sales Journals">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1"/>
<field name="date" select="1"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Sale journal search view -->
<record model="ir.ui.view" id="view_sale_journal_search">
<field name="name">sale_journal.sale.journal.search</field>
<field name="model">sale_journal.sale.journal</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Sales by Journal">
<group col="8" colspan="4">
<filter icon="terp-personal" string="My Sale Journals" domain="[('user_id','=',uid)]" help="My Sale Journals"/>
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Sale Journals"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1"/>
<field name="date" select="1"/>
</group>
</search>
</field>
</record>
<!-- Action for sale journal view -->
<record model="ir.actions.act_window" id="action_definition_journal">
<field name="res_model">sale_journal.sale.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_sale_journal_search"/>
</record>
<menuitem id="menu_definition_journal" name="Sales Journals" parent="base.menu_base_config" action="action_definition_journal" sequence="60" />
<!-- Inherit sales order form view -->
<record model="ir.ui.view" id="sale_journal_sale_order">
<field name="name">sale.order.journal.view.form</field>
<field name="type">form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<separator string="Journal" colspan="4"/>
<field name="journal_id" select="1" widget="selection"/>
<field name="invoice_type_id" select="1" widget="selection"/>
</field>
</field>
</record>
<!-- Inherit sales order tree view-->
<record model="ir.ui.view" id="sale_journal_sale_order_tree">
<field name="name">sale.order.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="state" position="after">
<field name="invoice_type_id"/>
<field name="journal_id"/>
</group>
</search>
</field>
</record>
</field>
</field>
</record>
<record model="ir.actions.act_window" id="action_sale_sale_stats_open_menu_all">
<field name="name">Sales by Journal</field>
<field name="res_model">sale_journal.sale.stats</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_sale_journal_sale_stats_search"/>
</record>
<!-- Inherit stock picking's form view -->
<menuitem name="Reporting" id="menu_definition_report_sales" parent="base.menu_base_partner" sequence="8"/>
<menuitem name="Sales by Journal" id="menu_sale_sale_stats_open_all" parent="menu_definition_report_sales" action="action_sale_sale_stats_open_menu_all"/>
<record model="ir.ui.view" id="sale_journal_picking_order">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<act_window name="Monthly sales"
domain="[('journal_id', '=', active_id)]"
res_model="sale_journal.sale.stats"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_journal_sale_stats"/>
<!-- Inherit stock picking's tree view -->
<act_window name="Assigned picking"
domain="[('journal_id', '=', active_id),('state', '=', 'assigned')]"
res_model="stock.picking"
src_model="sale_journal.picking.journal"
id="act_sale_journal_picking_journal_2_stock_picking_assigned"/>
<record model="ir.ui.view" id="sale_journal_picking_order_tree">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<act_window name="Confirmed picking"
domain="[('journal_id', '=', active_id),('state', '=', 'confirmed')]"
res_model="stock.picking"
src_model="sale_journal.picking.journal"
id="act_sale_journal_picking_journal_2_stock_picking_confirmed"/>
<!-- Inherit stock picking delivery's form view.-->
<act_window name="Assigned picking"
domain="[('sale_journal_id', '=', active_id),('state', '=', 'assigned')]"
res_model="stock.picking"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_stock_picking_assigned"/>
<record model="ir.ui.view" id="sale_journal_picking_order_del">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_delivery_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<act_window name="Confirmed picking"
domain="[('sale_journal_id', '=', active_id),('state', '=', 'confirmed')]"
res_model="stock.picking"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_stock_picking_confirmed"/>
<!-- Inherit stock picking delivery's tree view.-->
<act_window name="Draft sales"
domain="[('journal_id', '=', active_id),('state', '=', 'draft')]"
res_model="sale.order"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_order_draft"/>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_del">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_delivery_tree" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<act_window name="Approved sales"
domain="[('journal_id', '=', active_id),('state', '=', 'approved')]"
res_model="sale.order"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_order_approved"/>
<record model="ir.ui.view" id="sale_journal_picking_order_in">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_in_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.journal.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<field name="property_invoice_type"/>
</page>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_in">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_in_tree" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_journal_picking_order_out">
<field name="name">stock.picking.journal.view.form</field>
<field name="type">form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="sale_journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
</field>
</field>
</record>
</data>
<record model="ir.ui.view" id="sale_journal_picking_order_tree_out">
<field name="name">stock.picking.journal.view.tree</field>
<field name="type">tree</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_tree" />
<field name="arch" type="xml">
<field name="origin" position="after">
<field name="journal_id" select="1"/>
<field name="invoice_type_id" select="1"/>
<field name="sale_journal_id" select="1"/>
</field>
</field>
</record>
<!-- Action of sale journal report in sale journal -->
<act_window name="Monthly sales"
domain="[('journal_id', '=', active_id)]"
res_model="sale.journal.report"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_journal_sale_stats"/>
<!-- Action of stock picking in picking journal -->
<act_window name="Assigned picking"
domain="[('journal_id', '=', active_id),('state', '=', 'assigned')]"
res_model="stock.picking"
src_model="sale_journal.picking.journal"
id="act_sale_journal_picking_journal_2_stock_picking_assigned"/>
<!-- Action of stock picking in picking journal -->
<act_window name="Confirmed picking"
domain="[('journal_id', '=', active_id),('state', '=', 'confirmed')]"
res_model="stock.picking"
src_model="sale_journal.picking.journal"
id="act_sale_journal_picking_journal_2_stock_picking_confirmed"/>
<!-- Action of stock picking in sale journal -->
<act_window name="Assigned picking"
domain="[('sale_journal_id', '=', active_id),('state', '=', 'assigned')]"
res_model="stock.picking"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_stock_picking_assigned"/>
<!-- Action of stock picking in sale journal -->
<act_window name="Confirmed picking"
domain="[('sale_journal_id', '=', active_id),('state', '=', 'confirmed')]"
res_model="stock.picking"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_stock_picking_confirmed"/>
<!-- Action of sale order in sale journal -->
<act_window name="Draft sales"
domain="[('journal_id', '=', active_id),('state', '=', 'draft')]"
res_model="sale.order"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_order_draft"/>
<!-- Action of sale order in sale journal -->
<act_window name="Approved sales"
domain="[('journal_id', '=', active_id),('state', '=', 'approved')]"
res_model="sale.order"
src_model="sale_journal.sale.journal"
id="act_sale_journal_sale_journal_2_sale_order_approved"/>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.journal.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<field name="property_invoice_type"/>
</page>
</field>
</record>
<!--=====================================================-->
<!-- picking journal view-->
<!--===================================================== -->
<record model="ir.ui.view" id="view_picking_journal_form">
<field name="name">sale_journal.picking.journal.form</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Picking Journal">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1"/>
<newline/>
<field name="date" select="1"/>
<field name="date_created" select="1"/>
<field name="date_validation" select="1"/>
</group>
<notebook colspan="4">
<page string="Picking">
<field name="picking_stats_ids" colspan="4" nolabel="1"/>
</page>
<page string="Notes">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
<field name="state"/>
<group col="6" colspan="2">
<button name="button_open" string="Open Journal" states="draft" type="object" icon="gtk-open"/>
<button name="button_close" string="Close Journal" states="open" type="object" icon="gtk-close"/>
<button name="button_draft" string="Set to Draft" states="close,open" type="object" icon="gtk-convert"/>
<button string="Cancel Picking" name="button_picking_cancel" states="draft,open" type="object" icon="gtk-cancel"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_picking_journal_tree">
<field name="name">sale_journal.picking.journal.tree</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Picking Journal">
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1"/>
<field name="date" select="1"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Picking journal tree view -->
<record model="ir.ui.view" id="view_picking_journal_search">
<field name="name">sale_journal.picking.journal.search</field>
<field name="model">sale_journal.picking.journal</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking Journals">
<group col="8" colspan="4">
<filter icon="terp-personal" string="My Picking Journals" domain="[('user_id','=',uid)]" help="My Picking Journals"/>
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Picking Journals"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="user_id" select="1" widget="selection"/>
<field name="date" select="1"/>
</group>
</search>
</field>
</record>
<!-- Action of Picking journals -->
<record model="ir.actions.act_window" id="action_definition_picking_journal">
<field name="name">Picking Journals</field>
<field name="res_model">sale_journal.picking.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_picking_journal_search"/>
</record>
<menuitem name="Picking Journals" id="menu_definition_journal_picking" parent="stock.menu_stock_configuration" action="action_definition_picking_journal"/>
<record model="ir.actions.act_window" id="action_invoice_type_tree">
<field name="name">Picking by invoice_method</field>
<field name="res_model">sale_journal.invoice.type</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">tree</field>
</record>
<record model="ir.actions.act_window" id="action_invoice_type_picking_open">
<field name="name">Picking to invoice</field>
<field name="res_model">stock.picking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','done'),('invoice_state','=','2binvoiced'),('invoice_type_id','=',active_id)]</field>
</record>
<record model="ir.values" id="ir_open_invoice_type">
<field name="key2">tree_but_open</field>
<field name="model">sale_journal.invoice.type</field>
<field name="name">Picking to invoice</field>
<field name="value" eval="'ir.actions.act_window,%d'%action_invoice_type_picking_open"/>
<field name="object" eval="True"/>
</record>
</data>
</openerp>

View File

@ -1,12 +1,7 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_sale_journal_invoice_type_stats","sale_journal.invoice.type.stats","model_sale_journal_invoice_type_stats","sale.group_sale_user",1,0,0,0
"access_sale_journal_picking_stats","sale_journal.picking.stats","model_sale_journal_picking_stats","sale.group_sale_user",1,0,0,0
"access_sale_journal_invoice_type","sale_journal.invoice.type","model_sale_journal_invoice_type","sale.group_sale_user",1,0,0,0
"access_sale_journal_invoice_type_finance_invoice","sale_journal.invoice.type invoice","model_sale_journal_invoice_type","account.group_account_invoice",1,0,0,0
"access_sale_journal_invoice_type_partner_manager","sale_journal.invoice.type partner manager","model_sale_journal_invoice_type","base.group_partner_manager",1,0,0,0
"access_sale_journal_sale_journal","sale_journal.sale.journal","model_sale_journal_sale_journal","sale.group_sale_user",1,0,0,0
"access_sale_journal_picking_journal","sale_journal.picking.journal","model_sale_journal_picking_journal","sale.group_sale_user",1,0,0,0
"access_sale_journal_sale_stats","sale_journal.sale.stats","model_sale_journal_sale_stats","sale.group_sale_user",1,0,0,0
"access_sale_journal_invoice_type_manager","sale_journal.invoice.type.manager","model_sale_journal_invoice_type","sale.group_sale_manager",1,1,1,1
"access_sale_journal_sale_journal_manager","sale_journal.sale.journal.manager","model_sale_journal_sale_journal","sale.group_sale_manager",1,1,1,1
"access_sale_journal_picking_journal_manager","sale_journal.picking.journal.manager","model_sale_journal_picking_journal","sale.group_sale_manager",1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_sale_journal_invoice_type_stats sale_journal.invoice.type.stats model_sale_journal_invoice_type_stats sale.group_sale_user 1 0 0 0
access_sale_journal_picking_stats sale_journal.picking.stats model_sale_journal_picking_stats sale.group_sale_user 1 0 0 0
access_sale_journal_invoice_type sale_journal.invoice.type model_sale_journal_invoice_type sale.group_sale_user 1 0 0 0
2 access_sale_journal_invoice_type_finance_invoice sale_journal.invoice.type invoice model_sale_journal_invoice_type account.group_account_invoice 1 0 0 0
3 access_sale_journal_invoice_type_partner_manager sale_journal.invoice.type partner manager model_sale_journal_invoice_type base.group_partner_manager 1 0 0 0
4 access_sale_journal_sale_journal sale_journal.sale.journal model_sale_journal_sale_journal sale.group_sale_user 1 0 0 0
access_sale_journal_picking_journal sale_journal.picking.journal model_sale_journal_picking_journal sale.group_sale_user 1 0 0 0
access_sale_journal_sale_stats sale_journal.sale.stats model_sale_journal_sale_stats sale.group_sale_user 1 0 0 0
5 access_sale_journal_invoice_type_manager sale_journal.invoice.type.manager model_sale_journal_invoice_type sale.group_sale_manager 1 1 1 1
6 access_sale_journal_sale_journal_manager sale_journal.sale.journal.manager model_sale_journal_sale_journal sale.group_sale_manager 1 1 1 1
7 access_sale_journal_picking_journal_manager sale_journal.picking.journal.manager model_sale_journal_picking_journal sale.group_sale_manager 1 1 1 1

View File

@ -478,7 +478,7 @@ class stock_picking(osv.osv):
'delivery': _('Delivery order')
}
if not vals.get('auto_picking', False):
message = type_list.get(vals.get('type',_('Picking'))) + " '" + vals['name'] + "' "+ _("created.")
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + "' "+ _("created.")
self.log(cr, user, id, message)
return super(stock_picking, self).create(cr, user, vals, context)
@ -627,7 +627,7 @@ class stock_picking(osv.osv):
'internal': 'Internal picking',
'delivery': 'Delivery order'
}
message = type_list.get(pick.type, _('Document')) + " '" + pick.name + "' "+ _("is ready to be processed.")
message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or 'n/a') + "' "+ _("is ready to be processed.")
self.log(cr, uid, id, message)
self.write(cr, uid, ids, {'state': 'assigned'})
return True

View File

@ -588,6 +588,7 @@
<field name="origin"/>
<field name="date"/>
<field name="min_date"/>
<field name="invoice_state"/>
<field name="state"/>
<button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the picking. Do you want to continue?"/>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,62 +15,32 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
import netsvc
from osv import fields, osv
from tools.translate import _
class invoice_directly(wizard.interface):
def _test_action(obj, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
pick = pool.get('stock.picking').browse(cr, uid, data['id'], context=context)
if not pick.invoice_state == '2binvoiced':
return 'end_final'
return 'invoice'
class invoice_directly(osv.osv_memory):
_inherit = 'stock.partial.picking'
def _open_action(obj, cr, uid, data, context):
res = {
'name': 'stock.invoice_onshipping',
'type': 'ir.actions.wizard',
'wiz_name': 'stock.invoice_onshipping'
}
if data['form'].get('new_picking', False):
res['context'] = "{'new_picking':%d}" % (data['form']['new_picking'],)
return res
def do_partial(self, cr, uid, ids, context):
result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
pick_obj = self.pool.get('stock.picking')
picking_ids = context.get('active_ids', False)
pick = pick_obj.browse(cr, uid, picking_ids, context)[0]
if pick.invoice_state=='2binvoiced':
return {
'name': 'Create Invoice',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.invoice.onshipping',
'type': 'ir.actions.act_window',
'target': 'new',
}
return {}
end_final = {
'actions':[],
'result': {
'type': 'state',
'state': 'end',
}
}
choice = {
'actions':[],
'result': {
'type': 'choice',
'next_state': _test_action,
}
}
call_invoice = {
'actions':[],
'result': {
'type': 'action',
'action': _open_action,
'state': 'end'
}
}
def __init__(self, *args):
service = netsvc.LocalService("wizard.stock.partial_picking")
service._service.states['split']['result']['state'] = 'test_choice'
service._service.states['invoice'] = self.call_invoice
service._service.states['test_choice'] = self.choice
service._service.states['end_final'] = self.end_final
invoice_directly('stock.picking.invoice.directly')
invoice_directly()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -207,7 +207,7 @@ class survey_browse_response(report_rml):
<td><para style="terp_tblheader_General_Centre_simple">""" + to_xml(time.strftime('%d-%m-%Y %I:%M:%S %p', time.strptime(response.date_create.split('.')[0], '%Y-%m-%d %H:%M:%S'))) + """</para></td>
<td><para style="terp_tblheader_General_Centre"></para></td>
<td><para style="terp_tblheader_General_right">Answer By:- </para></td>
<td><para style="terp_tblheader_General_right_simple">""" + to_xml(response.user_id.login) + """</para></td>
<td><para style="terp_tblheader_General_right_simple">""" + to_xml(response.user_id.login or '') + """</para></td>
</tr>
</blockTable><para style="P2"></para>"""

View File

@ -149,11 +149,10 @@ class survey_form(report_rml):
<story>"""
surv_obj = pooler.get_pool(cr.dbname).get('survey')
for survey in surv_obj.browse(cr,uid,ids):
if datas.has_key('form') and datas['form']['survey_title']:
rml += """
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
</blockTable>"""
rml += """
<blockTable colWidths='"""+_tbl_widths+"""' style="title_tbl">
<tr><td><para style="title">""" + to_xml(tools.ustr(survey.title)) + """</para><para style="P2"><font></font></para></td></tr>
</blockTable>"""
if survey.note:
rml += """
<para style="P2"></para>

View File

@ -225,7 +225,7 @@ class survey_question(osv.osv):
'page_id': fields.many2one('survey.page', 'Survey Page', ondelete='cascade', required=1),
'question': fields.char('Question', size=128, required=1),
'answer_choice_ids': fields.one2many('survey.answer', 'question_id', 'Answer'),
'is_require_answer': fields.boolean('Require Answer to Question (optional)'),
'is_require_answer': fields.boolean('Require Answer to Question'),
'required_type': fields.selection([('all','All'), ('at least','At Least'), ('at most','At Most'), ('exactly','Exactly'), ('a range','A Range')], 'Respondent must answer'),
'req_ans': fields.integer('#Required Answer'),
'maximum_req_ans': fields.integer('Maximum Required Answer'),
@ -250,7 +250,7 @@ class survey_question(osv.osv):
('date_and_time','Date and Time'),('descriptive_text','Descriptive Text'),
('table','Table'),
], 'Question Type', required=1,),
'is_comment_require': fields.boolean('Add Comment Field (optional)'),
'is_comment_require': fields.boolean('Add Comment Field'),
'comment_label': fields.char('Field Label', size = 255),
'comment_field_type': fields.selection([('char', 'Single Line Of Text'), ('text', 'Paragraph of Text')], 'Comment Field Type'),
'comment_valid_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),
@ -269,7 +269,7 @@ class survey_question(osv.osv):
'comment_valid_err_msg': fields.text('Error message'),
'make_comment_field': fields.boolean('Make Comment Field an Answer Choice'),
'make_comment_field_err_msg': fields.text('Error message'),
'is_validation_require': fields.boolean('Validate Text (optional)'),
'is_validation_require': fields.boolean('Validate Text'),
'validation_type': fields.selection([('do_not_validate', '''Don't Validate Comment Text.'''),\
('must_be_specific_length', 'Must Be Specific Length'),\
('must_be_whole_number', 'Must Be A Whole Number'),\
@ -609,7 +609,7 @@ class survey_response(osv.osv):
reads = self.read(cr, uid, ids, ['user_id','date_create'], context)
res = []
for record in reads:
name = record['user_id'][1] + ' (' + record['date_create'].split('.')[0] + ')'
name = (record['user_id'] and record['user_id'][1] or '' )+ ' (' + record['date_create'].split('.')[0] + ')'
res.append((record['id'], name))
return res

View File

@ -24,6 +24,7 @@
<field name="state">open</field>
<field name="tot_comp_survey">1</field>
<field name="tot_start_survey">1</field>
<field name="response_user">5</field>
</record>
<record id="survey_page_who_are_you" model="survey.page">
@ -498,6 +499,7 @@
<field name="state">open</field>
<field name="tot_comp_survey">1</field>
<field name="tot_start_survey">1</field>
<field name="response_user">5</field>
</record>
<record id="survey_page_odoo_who_are_you" model="survey.page">
@ -1286,6 +1288,7 @@
<field name="responsible_id" ref="base.user_demo"/>
<field name="max_response_limit">20</field>
<field name="type" ref="survey_type2"/>
<field name="response_user">5</field>
</record>
</data>
<data>
@ -2163,6 +2166,8 @@
<field eval="1" name="send_response"/>
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey_type3"/>
<field name="response_user">5</field>
<field name="max_response_limit">20</field>
</record>
</data>
<data>

View File

@ -6,8 +6,7 @@
id="report_survey_form"
model="survey"
name="survey.form"
menu="False"
string="Survey Form"/>
string="Print Survey"/>
<report auto="True"
id="survey_analysis"

View File

@ -478,7 +478,7 @@
<field name="note" colspan="4" nolabel="1"/>
<group colspan="4">
<label string="" colspan="3"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-back"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
</group>
</form>
</field>
@ -805,7 +805,7 @@
</notebook>
<group colspan="4">
<label string="" colspan="3"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-ok"/>
<button name="survey_save" string="Ok" type="object" icon="gtk-go-forward"/>
</group>
</form>
</field>
@ -1156,11 +1156,11 @@
res_model="survey.answer"
src_model="survey.question"/>
<act_window domain="[('survey_id', '=', active_id)]"
<!--act_window domain="[('survey_id', '=', active_id)]"
id="act_survey_response"
name="Survey Answer"
res_model="survey.response"
src_model="survey"/>
src_model="survey"/-->
<menuitem name="Answer a Survey" id="menu_run_survey_form" sequence="2"
action="action_view_survey_name" parent="menu_answer_surveys"

View File

@ -46,7 +46,7 @@ class survey_browse_answer(osv.osv_memory):
_columns = {
'survey_id': fields.selection(_get_survey, "Survey", required="1"),
'response_id': fields.many2one("survey.response", "Survey Answer"),
'response_id': fields.many2one("survey.response", "Survey Answer", help="If you want to print all answer of selected survey then don't select survey answer and if you select survey answer then print only selected survey answer."),
}
def action_next(self, cr, uid, ids, context=None):

View File

@ -28,11 +28,12 @@ from tools.translate import _
class survey_print(osv.osv_memory):
_name = 'survey.print'
_columns = {
'survey_ids': fields.many2many('survey','survey_print',\
'survey_id','print_id', "Survey", required="1"),
'orientation' : fields.selection([('vertical','Portrait(Vertical)'),\
('horizontal','Landscape(Horizontal)')], 'Orientation'),
'paper_size' : fields.selection([('letter','Letter (8.5" x 11")'),\
('legal','Legal (8.5" x 14")'),('a4','A4 (210mm x 297mm)')], 'Paper Size'),
'survey_title' : fields.boolean('Include Survey Title'),
'page_number' : fields.boolean('Include Page Numvers'),
'without_pagebreak' : fields.boolean('Print Without Page Breaks'),
}
@ -40,7 +41,6 @@ class survey_print(osv.osv_memory):
_defaults = {
'orientation': lambda *a:'vertical',
'paper_size': lambda *a:'letter',
'survey_title':lambda *a: 0,
'page_number':lambda *a: 0,
'without_pagebreak':lambda *a: 0
}
@ -57,7 +57,7 @@ class survey_print(osv.osv_memory):
@return : Dictionary value for print survey form.
"""
datas = {'ids' : context.get('active_ids', [])}
datas = {'ids' : self.read(cr, uid, ids, [], context)[0]['survey_ids']}
res = self.read(cr, uid, ids, ['survey_title', 'orientation', 'paper_size',\
'page_number', 'without_pagebreak'], context)
res = res and res[0] or {}

Some files were not shown because too many files have changed in this diff Show More