diff options
| author | Vir (Open ERP) <vir@tinyerp.com> | 2010-06-02 13:53:32 +0530 |
|---|---|---|
| committer | Vir (Open ERP) <vir@tinyerp.com> | 2010-06-02 13:53:32 +0530 |
| commit | a00a181d98fdb43a9987e8117ef70eac2d09638a (patch) | |
| tree | ffe3e986d4427b3132e268e2c83ba11fca27eb62 /addons | |
| parent | d1cfcf4c5cf99b98883613418d076e606864e8b7 (diff) | |
| parent | 8397cd973da9ae5033ad11a3c121f02e6aa7d653 (diff) | |
[Merge] Merge with trunk addons
bzr revid: vir@tinyerp.com-20100602082332-bq3vbck48iyd4thx
Diffstat (limited to 'addons')
111 files changed, 2327 insertions, 2067 deletions
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 36b65d20dca..7350596c4e3 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -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']) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 4af3b43d54c..d8205ababa7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -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): diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 286d0f1d79e..e1e43420d6e 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -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> diff --git a/addons/account_analytic_analysis/i18n/pt.po b/addons/account_analytic_analysis/i18n/pt.po index fdd81c9e070..36f79ba1a7a 100644 --- a/addons/account_analytic_analysis/i18n/pt.po +++ b/addons/account_analytic_analysis/i18n/pt.po @@ -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." diff --git a/addons/account_analytic_plans/i18n/pt.po b/addons/account_analytic_plans/i18n/pt.po index 7b17be3392e..59d93dbf74f 100644 --- a/addons/account_analytic_plans/i18n/pt.po +++ b/addons/account_analytic_plans/i18n/pt.po @@ -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 diff --git a/addons/account_invoice_layout/i18n/pt.po b/addons/account_invoice_layout/i18n/pt.po index cbfbfc454a2..e61eb9a0564 100644 --- a/addons/account_invoice_layout/i18n/pt.po +++ b/addons/account_invoice_layout/i18n/pt.po @@ -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 diff --git a/addons/account_reporting/i18n/pt.po b/addons/account_reporting/i18n/pt.po index 03f50826416..9d810d497ad 100644 --- a/addons/account_reporting/i18n/pt.po +++ b/addons/account_reporting/i18n/pt.po @@ -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 diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index ce07647dc92..2bd56a3b513 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -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> diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index bf93c9c775d..8a9764bff63 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -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, diff --git a/addons/board/i18n/pt.po b/addons/board/i18n/pt.po index d2766a3cc5c..6ceaf2a831a 100644 --- a/addons/board/i18n/pt.po +++ b/addons/board/i18n/pt.po @@ -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 diff --git a/addons/caldav/security/ir.model.access.csv b/addons/caldav/security/ir.model.access.csv index 4dd04fa4c68..fa7b85a39f1 100644 --- a/addons/caldav/security/ir.model.access.csv +++ b/addons/caldav/security/ir.model.access.csv @@ -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 diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 386387b1157..ea5cf3f6ef2 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -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: diff --git a/addons/crm/crm.py b/addons/crm/crm.py index ba45efd4b3b..d3c640efca3 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -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 = { diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 3a14659672a..9092efef8e8 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -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 user’s 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 = [] diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index cfff95888cc..1873f53f573 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -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> diff --git a/addons/crm/crm_installer.py b/addons/crm/crm_installer.py index 1d9235feac6..8fb7c02ff85 100644 --- a/addons/crm/crm_installer.py +++ b/addons/crm/crm_installer.py @@ -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): diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml index 370285352d1..e0d84c6eed2 100644 --- a/addons/crm/crm_installer_view.xml +++ b/addons/crm/crm_installer_view.xml @@ -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> diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index a9e8d1c000f..c1060f3e658 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -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\'.\ diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 2178207b7bf..31872e27ef4 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -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" diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index e2decc30340..e84bbb673ee 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -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 --> diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index efdde211289..8b5cc42c502 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -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" - 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"/> + <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" /> + <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" /> + <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> - <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" 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> - <separator colspan="4"/> - <group col="8" colspan="4"> + <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 < 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="draft,open" type="object" + states="open,draft" 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" + <button name="case_cancel" string="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> + icon="gtk-cancel" /> + </tree> + </field> + </record> - <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 Graph View --> - <!-- Opportunities Tree 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> - <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 < 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 Search View --> - <!-- Opportunities Graph 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','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', 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','<', time.strftime('%%Y-%%m-%%d')),\ + ('create_date','>=',(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'}" /> - <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> + <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 Search View --> + <!-- Opportunities Graph 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','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', 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','<', time.strftime('%%Y-%%m-%%d')),\ - ('create_date','>=',(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"/> - </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" /> + <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> - <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'}"/> - - <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> + </record> </data> </openerp> diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 205b30d39dc..cc26ad89c89 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -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.'), diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index c5813a38b09..65b77ed5abe 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -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 --> diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index f854981858c..52450419fd2 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -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> diff --git a/addons/crm/i18n/es.po b/addons/crm/i18n/es.po index 79f079d2df0..3efa06d3d90 100644 --- a/addons/crm/i18n/es.po +++ b/addons/crm/i18n/es.po @@ -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 diff --git a/addons/crm/i18n/pt.po b/addons/crm/i18n/pt.po index f90c62ca5cc..a751a326814 100644 --- a/addons/crm/i18n/pt.po +++ b/addons/crm/i18n/pt.po @@ -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 diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py index 2c0fa8c8fc6..39806c50803 100644 --- a/addons/crm/report/crm_lead_report.py +++ b/addons/crm/report/crm_lead_report.py @@ -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() diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index da480d21dc0..770d9292b6f 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -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" /> diff --git a/addons/crm/res_partner.py b/addons/crm/res_partner.py index 93d865d7f74..3d2dc0373a5 100644 --- a/addons/crm/res_partner.py +++ b/addons/crm/res_partner.py @@ -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() diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 540c8d13186..24523f7b072 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -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> diff --git a/addons/crm/scripts/php/crmlead.php b/addons/crm/scripts/php/crmlead.php index aa23e5c78ba..91cfe7649ed 100644 --- a/addons/crm/scripts/php/crmlead.php +++ b/addons/crm/scripts/php/crmlead.php @@ -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"), diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 1f90f74f281..bbd437dba47 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -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 diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index bfdbe912fed..13706c7bb17 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -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. - + diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py index 153f136cfb2..156ab3311f4 100644 --- a/addons/crm/wizard/crm_forward_to_partner.py +++ b/addons/crm/wizard/crm_forward_to_partner.py @@ -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' ] diff --git a/addons/crm/wizard/crm_lead_to_partner.py b/addons/crm/wizard/crm_lead_to_partner.py index 2decc56b806..98a075ba1ba 100644 --- a/addons/crm/wizard/crm_lead_to_partner.py +++ b/addons/crm/wizard/crm_lead_to_partner.py @@ -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, diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index 8458172104a..8bc63f2f1a1 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -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 = { diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml index acbacc766e6..2b3f883024c 100644 --- a/addons/crm_claim/crm_claim_view.xml +++ b/addons/crm_claim/crm_claim_view.xml @@ -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> diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml index 7e5ce28b76b..6853da7c89a 100644 --- a/addons/crm_fundraising/crm_fundraising_view.xml +++ b/addons/crm_fundraising/crm_fundraising_view.xml @@ -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" diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml index 17e3772e50c..451f6c7119e 100644 --- a/addons/crm_helpdesk/crm_helpdesk_view.xml +++ b/addons/crm_helpdesk/crm_helpdesk_view.xml @@ -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" diff --git a/addons/document/__openerp__.py b/addons/document/__openerp__.py index 8a78ae46fdd..ac227827d11 100644 --- a/addons/document/__openerp__.py +++ b/addons/document/__openerp__.py @@ -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, diff --git a/addons/document/document.py b/addons/document/document.py index 2b2ac2f7587..5d3075f7a4a 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -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): diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 56e52aa9b69..e395f96833d 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -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: diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 720ab6de69f..fd424ad7d52 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -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" attrs="{'invisible':[('type','=','binary')]}"> + <field name="url" widget="url"/> + </group> + </group> + + <group col="2" colspan="2"> - <separator string="Attached To" colspan="2"/> - <field name="res_model" readonly="1"/> - <field name="res_id" readonly="1"/> + <separator string="Relation" colspan="2"/> + <field name="res_name" readonly="1"/> + <field name="partner_id"/> + <field name="user_id"/> </group> - <separator string="Preview" colspan="4"/> - <field - name="preview" - widget="image" - readonly="1" - nolabel="1" - colspan="4" - img_height="400" - img_width="800"/> - - </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 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','<=', time.strftime('%%Y-%%m-%%d')),('create_date','>',(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> diff --git a/addons/document/report/document_report.py b/addons/document/report/document_report.py index efe3a8183ab..d3964fc2d99 100644 --- a/addons/document/report/document_report.py +++ b/addons/document/report/document_report.py @@ -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 diff --git a/addons/document/report/document_report_view.xml b/addons/document/report/document_report_view.xml index c6d59fa3d29..4afc66fb4d7 100644 --- a/addons/document/report/document_report_view.xml +++ b/addons/document/report/document_report_view.xml @@ -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> diff --git a/addons/document/std_index.py b/addons/document/std_index.py index 4979c05a17d..2f2f2094bc3 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -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. diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index 70870b50783..66e4a994cba 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -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: diff --git a/addons/document_ics/__openerp__.py b/addons/document_ics/__openerp__.py index 4f3326fe635..4ad979fec5c 100644 --- a/addons/document_ics/__openerp__.py +++ b/addons/document_ics/__openerp__.py @@ -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/>. # ############################################################################## diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 37ac26ac7b4..8bc1712dbf9 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -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"/> diff --git a/addons/event/wizard/event_make_invoice.py b/addons/event/wizard/event_make_invoice.py index 1e8505a74e9..e4eacf99d3c 100644 --- a/addons/event/wizard/event_make_invoice.py +++ b/addons/event/wizard/event_make_invoice.py @@ -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'] diff --git a/addons/hr_evaluation/hr_evaluation_demo.xml b/addons/hr_evaluation/hr_evaluation_demo.xml index 2ad9629d61a..83776dde4cd 100644 --- a/addons/hr_evaluation/hr_evaluation_demo.xml +++ b/addons/hr_evaluation/hr_evaluation_demo.xml @@ -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> diff --git a/addons/hr_recruitment/hr_recruitment_demo.xml b/addons/hr_recruitment/hr_recruitment_demo.xml index fd4920a1199..3eba3bc17de 100644 --- a/addons/hr_recruitment/hr_recruitment_demo.xml +++ b/addons/hr_recruitment/hr_recruitment_demo.xml @@ -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> diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 591a6474801..433ad5fb71e 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -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'}" diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 1530f18981c..a9965e7d9a9 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -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) diff --git a/addons/idea/i18n/id.po b/addons/idea/i18n/id.po index da1e1c37693..1ecdb11dd08 100644 --- a/addons/idea/i18n/id.po +++ b/addons/idea/i18n/id.po @@ -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 diff --git a/addons/idea/idea.py b/addons/idea/idea.py index e46115c5639..74c6de9f721 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -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() diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml index b268a64d991..18a268a410b 100644 --- a/addons/idea/idea_view.xml +++ b/addons/idea/idea_view.xml @@ -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> diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv index 0c720f2ee2d..0fe5dad9ac9 100644 --- a/addons/idea/security/ir.model.access.csv +++ b/addons/idea/security/ir.model.access.csv @@ -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 diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index 6714fbfc7e2..4c3f5301a5a 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -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. diff --git a/addons/idea/wizard/idea_post_vote.py b/addons/idea/wizard/idea_post_vote.py index f68496c8ae5..20ef22a5f2d 100644 --- a/addons/idea/wizard/idea_post_vote.py +++ b/addons/idea/wizard/idea_post_vote.py @@ -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: diff --git a/addons/idea/wizard/idea_post_vote_view.xml b/addons/idea/wizard/idea_post_vote_view.xml index aa066cdffd3..ef1a338dcd4 100644 --- a/addons/idea/wizard/idea_post_vote_view.xml +++ b/addons/idea/wizard/idea_post_vote_view.xml @@ -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> diff --git a/addons/mail_gateway/__openerp__.py b/addons/mail_gateway/__openerp__.py index aaf12b926b3..1584067ea38 100644 --- a/addons/mail_gateway/__openerp__.py +++ b/addons/mail_gateway/__openerp__.py @@ -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, diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 05d27ce3ef2..fb4920e9632 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -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() diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml index dc145754767..611416055f7 100644 --- a/addons/mail_gateway/mail_gateway_view.xml +++ b/addons/mail_gateway/mail_gateway_view.xml @@ -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="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_base_config" sequence="100"/> - --> + <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>
\ No newline at end of file diff --git a/addons/product/product.py b/addons/product/product.py index 18c9e6ded8d..aaa369cdfcf 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -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: diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml index ce2cc1ee632..d5aaae658d4 100644 --- a/addons/product/product_data.xml +++ b/addons/product/product_data.xml @@ -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> <!-- diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 37bdddfeb8c..11ed4bfba65 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -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> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index fff8cf07df3..9631e3151f6 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -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" diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 9a761e4141e..c2e871f685a 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -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: diff --git a/addons/purchase/purchase_data.xml b/addons/purchase/purchase_data.xml index 0a6659d244f..2b57a2a75bc 100644 --- a/addons/purchase/purchase_data.xml +++ b/addons/purchase/purchase_data.xml @@ -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> diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 74c25c0b430..e684a1a6c1d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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 diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index e1a8998e1d3..2be5a50ff81 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -10,16 +10,6 @@ </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 --> <record id="shop" model="sale.shop"> diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index fd9499deb58..4d82e8595ad 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -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','<>','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" diff --git a/addons/sale/wizard/sale_line_invoice.xml b/addons/sale/wizard/sale_line_invoice.xml index 436fabc91fc..0420a8c3404 100644 --- a/addons/sale/wizard/sale_line_invoice.xml +++ b/addons/sale/wizard/sale_line_invoice.xml @@ -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> diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index 92777da17e5..bf5f1aaac52 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -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> diff --git a/addons/sale_crm/wizard/makesale.py b/addons/sale_crm/wizard/makesale.py index 1a1d2387da9..e4aacce1044 100644 --- a/addons/sale_crm/wizard/makesale.py +++ b/addons/sale_crm/wizard/makesale.py @@ -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 = { diff --git a/addons/sale_journal/__init__.py b/addons/sale_journal/__init__.py index 4cb6588ed18..f846067a3b4 100644 --- a/addons/sale_journal/__init__.py +++ b/addons/sale_journal/__init__.py @@ -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: diff --git a/addons/sale_journal/__openerp__.py b/addons/sale_journal/__openerp__.py index d204d4a3ee5..94d343debb9 100644 --- a/addons/sale_journal/__openerp__.py +++ b/addons/sale_journal/__openerp__.py @@ -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, diff --git a/addons/sale_journal/picking_journal_view.xml b/addons/sale_journal/picking_journal_view.xml deleted file mode 100644 index 4db38bfcd41..00000000000 --- a/addons/sale_journal/picking_journal_view.xml +++ /dev/null @@ -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> diff --git a/addons/sale_journal/picking_journal_view_report.xml b/addons/sale_journal/picking_journal_view_report.xml deleted file mode 100644 index 0c842bca9d3..00000000000 --- a/addons/sale_journal/picking_journal_view_report.xml +++ /dev/null @@ -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> diff --git a/addons/sale_journal/report/__init__.py b/addons/sale_journal/report/__init__.py new file mode 100644 index 00000000000..0f9b6da35da --- /dev/null +++ b/addons/sale_journal/report/__init__.py @@ -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:
\ No newline at end of file diff --git a/addons/sale_journal/report/sale_journal_report.py b/addons/sale_journal/report/sale_journal_report.py new file mode 100644 index 00000000000..0607f3be607 --- /dev/null +++ b/addons/sale_journal/report/sale_journal_report.py @@ -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: diff --git a/addons/sale_journal/report/sale_journal_report_view.xml b/addons/sale_journal/report/sale_journal_report_view.xml new file mode 100644 index 00000000000..aa0a9cf06fe --- /dev/null +++ b/addons/sale_journal/report/sale_journal_report_view.xml @@ -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> diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py index 8b636241285..50e09a96997 100644 --- a/addons/sale_journal/sale_journal.py +++ b/addons/sale_journal/sale_journal.py @@ -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: diff --git a/addons/sale_journal/sale_journal_inherit.py b/addons/sale_journal/sale_journal_inherit.py deleted file mode 100644 index f9834862aa7..00000000000 --- a/addons/sale_journal/sale_journal_inherit.py +++ /dev/null @@ -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: - diff --git a/addons/sale_journal/sale_journal_picking_report.py b/addons/sale_journal/sale_journal_picking_report.py deleted file mode 100644 index e13b64cc4d6..00000000000 --- a/addons/sale_journal/sale_journal_picking_report.py +++ /dev/null @@ -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: - diff --git a/addons/sale_journal/sale_journal_report.py b/addons/sale_journal/sale_journal_report.py deleted file mode 100644 index e77d7569004..00000000000 --- a/addons/sale_journal/sale_journal_report.py +++ /dev/null @@ -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: - diff --git a/addons/sale_journal/sale_journal_view.xml b/addons/sale_journal/sale_journal_view.xml index 841fa728d06..7e4cc33b283 100644 --- a/addons/sale_journal/sale_journal_view.xml +++ b/addons/sale_journal/sale_journal_view.xml @@ -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> - -<!-- <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="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_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"/> - <field name="name"/> - <field name="code"/> - <field name="user_id"/> - <field name="date" /> - </group> - </search> - </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> - -<!-- <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.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> - - <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> - - <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"/> + <data> + + <!-- sale journal invoice Type's Form view --> + + <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> + + <!-- 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="invoicing_method"/> + </tree> + </field> + </record> + + <!-- Action for sale journal invoice Type --> + + <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> + + <!-- <menuitem name="Invoicing Methods" id="menu_definition_journal_invoice_type" parent="sale.menu_shop_configuration" action="action_definition_journal_invoice_type"/> --> + + <!-- sale journal 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="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> - - <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> - - <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"/> - - <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"/> - - <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"/> - - <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"/> - - <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"/> - - <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"/> - - <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"/> - - <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 & Purchases" position="inside"> - <field name="property_invoice_type"/> - </page> - </field> - </record> - - -</data> + </field> + </field> + </record> + +<!-- Inherit stock picking's form view --> + + <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> + +<!-- Inherit stock picking's tree 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="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> + + <!-- Inherit stock picking delivery's form view.--> + + <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> + + <!-- Inherit stock picking delivery's tree view.--> + + <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="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> + + <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 & 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> diff --git a/addons/sale_journal/security/ir.model.access.csv b/addons/sale_journal/security/ir.model.access.csv index f958ecb8420..0a7ed3742ab 100644 --- a/addons/sale_journal/security/ir.model.access.csv +++ b/addons/sale_journal/security/ir.model.access.csv @@ -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 diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 78f25708495..6c3d09f2895 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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 diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index eb13d054c94..92653501ed3 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -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?"/> diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py index ce468422b7f..2eaf0adb4a6 100644 --- a/addons/stock_invoice_directly/wizard/stock_invoice.py +++ b/addons/stock_invoice_directly/wizard/stock_invoice.py @@ -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 - -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' - - 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 +from osv import fields, osv +from tools.translate import _ - end_final = { - 'actions':[], - 'result': { - 'type': 'state', - 'state': 'end', - } - } +class invoice_directly(osv.osv_memory): + _inherit = 'stock.partial.picking' - choice = { - 'actions':[], - 'result': { - 'type': 'choice', - 'next_state': _test_action, - } - } + 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 {} - 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: diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index 8063e6183a9..a8bfa906c90 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -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>""" diff --git a/addons/survey/report/survey_form.py b/addons/survey/report/survey_form.py index 2c1de9cc71d..5a7d5e283e3 100644 --- a/addons/survey/report/survey_form.py +++ b/addons/survey/report/survey_form.py @@ -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> diff --git a/addons/survey/survey.py b/addons/survey/survey.py index c7ceb796bae..c86f13b262f 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -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 diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index 3eca378f150..68e6c1e9883 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -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> diff --git a/addons/survey/survey_report.xml b/addons/survey/survey_report.xml index c74d9d1d544..c5e76dd133f 100644 --- a/addons/survey/survey_report.xml +++ b/addons/survey/survey_report.xml @@ -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" diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 8a574edc169..f838739d0da 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -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" diff --git a/addons/survey/wizard/survey_browse_answer.py b/addons/survey/wizard/survey_browse_answer.py index 3f4fb753fa3..4b74021b8a1 100644 --- a/addons/survey/wizard/survey_browse_answer.py +++ b/addons/survey/wizard/survey_browse_answer.py @@ -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): diff --git a/addons/survey/wizard/survey_print.py b/addons/survey/wizard/survey_print.py index d13d006312e..601b3c4e786 100644 --- a/addons/survey/wizard/survey_print.py +++ b/addons/survey/wizard/survey_print.py @@ -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 {} diff --git a/addons/survey/wizard/survey_print.xml b/addons/survey/wizard/survey_print.xml index e5a42e17103..9470a8bfc3b 100644 --- a/addons/survey/wizard/survey_print.xml +++ b/addons/survey/wizard/survey_print.xml @@ -10,10 +10,11 @@ <field name="type">form</field> <field name="arch" type="xml"> <form string="Survey Print"> + <separator string="Survey" colspan="4"/> + <field name="survey_ids" nolabel="1" colspan="4" /> <separator string="Print Option" colspan="4"/> <field name="orientation" colspan="4"/> <field name="paper_size" colspan="4"/> - <field name="survey_title" colspan="4"/> <field name="page_number" colspan="4"/> <field name="without_pagebreak" colspan="4"/> <separator colspan="4" /> @@ -34,10 +35,9 @@ <field name="target">new</field> </record> - <act_window id="action_act_view_survey_print" - key2="client_action_multi" name="Print Survey" - res_model="survey.print" src_model="survey" - view_mode="form" target="new" view_type="form" /> + <menuitem name="Print Survey" id="menu_print_survey_form" sequence="1" + action="action_view_survey_print" parent="menu_reporting" + groups="group_survey_manager" icon="STOCK_PRINT"/> </data> </openerp>
\ No newline at end of file diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py index 4e0f4435d31..c93e10080ed 100644 --- a/addons/thunderbird/installer.py +++ b/addons/thunderbird/installer.py @@ -29,38 +29,28 @@ class thunderbird_installer(osv.osv_memory): _name = 'thunderbird.installer' _inherit = 'res.config.installer' - def process_plugin(self, cr, uid, ids, context): - """ - Default Attach Thunderbird Plug-in File. - """ - data = {} - file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r') - data['plugin_file'] = base64.encodestring(file.read()) - self.write(cr, uid, ids, data) - return False - - def process_pdf_file(self, cr, uid, ids, context): - """ - Default Attach Thunderbird Plug-in Installation File. - """ - data = {} + def default_get(self, cr, uid, fields, context={}): + data = super(thunderbird_installer, self).default_get(cr, uid, fields, context) pdf_file = open(config['addons_path'] + "/thunderbird/doc/Installation Guide to OpenERP Thunderbid Plug-in.pdf", 'r') data['pdf_file'] = base64.encodestring(pdf_file.read()) - self.write(cr, uid, ids, data) - return False + file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r') + data['plugin_file'] = base64.encodestring(file.read()) + return data _columns = { 'name':fields.char('File name', size=34), 'pdf_name':fields.char('File name', size=64), 'thunderbird':fields.boolean('Thunderbird Module ', help="Allows you to select an object that you’d like to add to your email and its attachments."), - 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbir."), - 'pdf_file':fields.binary('Thunderbird Plug-in Installation File', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True), + 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."), + 'pdf_file':fields.binary('Installation Manual', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True), + 'description':fields.text('Description', readonly=True) } _defaults = { 'thunderbird' : True, 'name' : 'tiny_plugin-2.0.xpi', 'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf', + 'description' : """ * Save The thunderbird plugin Follow the following step to install thunderbird plugin. \n -> 1. From Menu Bar, Open Tools > Add ons. \n -> 2. Now click on install button and a browser window will appear. \n -> 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. \n -> 4. Click on Install Now and restart Thunderbird. \n -> 5. Now Thunderbird plugin is installed.""" } thunderbird_installer() diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index f7c3f41a776..f91a4e29737 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -90,9 +90,9 @@ class tinythunderbird_partner(osv.osv): case_pool=self.pool.get(dictcreate.get('object','crm.case'))
partner_ids=add_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
- if partner:
+ if partner and partner[0] and partner[0]['partner_id']:
dictcreate.update({'partner_id':partner[0]['partner_id'][0]})
- create_id = self.pool.get(dictcreate.get('object','crm.case')).create(cr, user, dictcreate)
+ create_id = case_pool.create(cr, user, dictcreate)
cases=case_pool.browse(cr,user,[create_id])
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
return create_id
@@ -104,10 +104,11 @@ class tinythunderbird_partner(osv.osv): def thunderbird_createpartner(self,cr,user,vals):
dictcreate = dict(vals)
- search_id = self.pool.get('res.partner').search(cr, user,[('name','=',dictcreate['name'])])
+ address_obj = self.pool.get('res.partner')
+ search_id = address_obj.search(cr, user,[('name','=',dictcreate['name'])])
if search_id:
return 0
- create_id = self.pool.get('res.partner').create(cr, user, dictcreate)
+ create_id = address_obj.create(cr, user, dictcreate)
return create_id
def thunderbird_searchobject(self,cr,user,vals):
@@ -116,12 +117,13 @@ class tinythunderbird_partner(osv.osv): return (search_id and search_id[0]) or 0
def thunderbird_searchcontact(self,cr,user,vals):
- search_id1 = self.pool.get('res.partner.address').search(cr,user,[('name','ilike',vals)])
- search_id2 = self.pool.get('res.partner.address').search(cr,user,[('email','=',vals)])
+ address_obj = self.pool.get('res.partner.address')
+ search_id1 = address_obj.search(cr,user,[('name','ilike',vals)])
+ search_id2 = address_obj.search(cr,user,[('email','=',vals)])
if search_id1:
- return self.pool.get('res.partner.address').name_get(cr, user, search_id1)
+ return address_obj.name_get(cr, user, search_id1)
elif search_id2:
- return self.pool.get('res.partner.address').name_get(cr, user, search_id2)
+ return address_obj.name_get(cr, user, search_id2)
return []
def thunderbird_tempsearch(self,cr,user,vals):
@@ -132,21 +134,22 @@ class tinythunderbird_partner(osv.osv): name_get=[]
er_val=[]
for object in obj:
+ dyn_object = self.pool.get(object)
if object == 'res.partner.address':
- search_id1 = self.pool.get(object).search(cr,user,[('name','ilike',value)])
- search_id2 = self.pool.get(object).search(cr,user,[('email','=',value)])
+ search_id1 = dyn_object.search(cr,user,[('name','ilike',value)])
+ search_id2 = dyn_object.search(cr,user,[('email','=',value)])
if search_id1:
name_get.append(object)
- name_get.append(self.pool.get(object).name_get(cr, user, search_id1))
+ name_get.append(dyn_object.name_get(cr, user, search_id1))
elif search_id2:
name_get.append(object)
- name_get.append(self.pool.get(object).name_get(cr, user, search_id2))
+ name_get.append(dyn_object.name_get(cr, user, search_id2))
else:
try:
- search_id1 = self.pool.get(object).search(cr,user,[('name','ilike',value)])
+ search_id1 = dyn_object.search(cr,user,[('name','ilike',value)])
if search_id1:
name_get.append(object)
- name_get.append(self.pool.get(object).name_get(cr, user, search_id1))
+ name_get.append(dyn_object.name_get(cr, user, search_id1))
except:
er_val.append(object)
continue
@@ -179,17 +182,38 @@ class tinythunderbird_partner(osv.osv): def read(self, cr, user, ids, fields=None, context={}, load='_classic_read'):
ret_read = super(tinythunderbird_partner, self).read(cr, user, ids,fields,context,load)
+ attach_obj = self.pool.get('ir.attachment')
for read_data in ret_read:
- attachments = self.pool.get('ir.attachment').search(cr,user,[('res_model','=',self._name),('res_id','=',read_data['id'])])
- attechments_data = self.pool.get('ir.attachment').read(cr,user,attachments,['name'])
+ attachments = attach_obj.search(cr,user,[('res_model','=',self._name),('res_id','=',read_data['id'])])
+ attechments_data = sattach_obj.read(cr,user,attachments,['name'])
file_names = [a['name'] for a in attechments_data]
text_atteched = '\n'.join(file_names)
read_data['attachments'] = text_atteched
return ret_read
def unlink(self, cr, uid, ids, context={}):
- attachments = self.pool.get('ir.attachment').search(cr,uid,[('res_model','=',self._name),('res_id','in',ids)])
- self.pool.get('ir.attachment').unlink(cr,uid,attachments)
+ attach_obj = self.pool.get('ir.attachment')
+ attachments = attach_obj.search(cr,uid,[('res_model','=',self._name),('res_id','in',ids)])
+ attach_obj.unlink(cr,uid,attachments)
return super(tinythunderbird_partner, self).unlink(cr, uid, ids,context)
-tinythunderbird_partner() + def thunderbird_objectsearch(self,cr,user,vals):
+ obj_list= [('crm.claim', 'Claim'), ('crm.lead','Lead'), ('crm.meeting','Metting'), ('crm.opportunity','Opportunity'), ('crm.phonecall','Phonecall'), ('crm.fundraising','Fund raising'), ('crm.helpdesk','Helpdesk')]
+ object=[]
+ model_obj = self.pool.get('ir.model')
+ for obj in obj_list:
+ if model_obj.search(cr, user, [('model', '=', obj[0])]):
+ object.append(obj)
+ return object
+
+ def thunderbird_list_search_object(self,cr,user,vals):
+ model_obj = self.pool.get('ir.model')
+ object=''
+ for obj in vals[0][1].split(','):
+ if model_obj.search(cr, user, [('model', '=', obj)]):
+ object += obj + ","
+ else:
+ object += "null,"
+ return object
+
+tinythunderbird_partner()
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi Binary files differnew file mode 100644 index 00000000000..ef42a9a0c14 --- /dev/null +++ b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi diff --git a/addons/thunderbird/security/ir.model.access.csv b/addons/thunderbird/security/ir.model.access.csv index fdd310a0679..b7cc3262e2d 100644 --- a/addons/thunderbird/security/ir.model.access.csv +++ b/addons/thunderbird/security/ir.model.access.csv @@ -1,3 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_tinythunderbird_partner","tinythunderbird.partner","model_tinythunderbird_partner",,1,1,1,1 - +"access_thunderbird_installer","thunderbird.installer","model_thunderbird_installer","base.group_user",1,1,1,1 diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml index 356282d2de5..34812a38cee 100644 --- a/addons/thunderbird/thunderbird_installer.xml +++ b/addons/thunderbird/thunderbird_installer.xml @@ -29,13 +29,11 @@ <newline/> <field name="plugin_file" filename="name"/> - <button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/> <newline/> <field name="pdf_file" filename="pdf_name"/> - <button name="process_pdf_file" icon="gtk-execute" string="Get Plugin Installation File" type="object"/> <newline/> <separator string="Thunderbird plugin installation note." colspan="4"/> - <label colspan="8" string="Save The thunderbird plugin Follow the following step to install thunderbird plugin ? 1. From Menu Bar, Open Tools > Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugin is installed."/> + <field name="description" nolabel="1" colspan="8"/> </group> </group> </data> @@ -74,16 +72,18 @@ <label align="0.0" string="This module is required for the thuderbird plug-in to work properly.This allows you to select an object that you had like to add to your email and its attachments. You can select a partner, a task, a project, an analytical account, or any other object and attach selected mail as .eml file in attachment of selected record." width="200"/> </group> <group colspan="8"> - <separator string="Thunderbird" colspan="4"/> - <field name="thunderbird"/> - <field name="name" invisible="1"/> - <newline/> - <field name="plugin_file"/> - <button name="process_plugin" icon="gtk-execute" string="Get Plugin File" type="object"/> - <newline/> - <separator string="Thunderbird plugin installation note." colspan="4"/> - <label colspan="8" string="Save The thunderbird plugin Follow the following step to install thunderbird plugin ? 1. From Menu Bar, Open Tools > Add ons. 2. Now click on install button and a browser window will appear. 3. Just select the (.xpi) file from thunderbird/plugin directory and click ok, a new software installation window will appear and within a short time Install Now button will be enabled. 4. Click on Install Now and restart Thunderbird. 5. Now Thunderbird plugin is installed."/> - </group> + <field name="thunderbird"/> + <field name="name" invisible="1"/> + <field name="pdf_name" invisible="1"/> + <newline/> + + <field name="plugin_file" filename="name"/> + <newline/> + <field name="pdf_file" filename="pdf_name"/> + <newline/> + <separator string="Thunderbird plugin installation note." colspan="4"/> + <field name="description" nolabel="1" colspan="8"/> + </group> </group> </group> <separator string="" colspan="4"/> diff --git a/addons/wiki/wiki_view.xml b/addons/wiki/wiki_view.xml index 93f0df72361..272dad32683 100644 --- a/addons/wiki/wiki_view.xml +++ b/addons/wiki/wiki_view.xml @@ -21,7 +21,7 @@ <field name="model">wiki.groups</field> <field name="type">tree</field> <field name="arch" type="xml"> - <tree string="Wikis"> + <tree string="Wiki Groups"> <field name="name"/> </tree> </field> @@ -34,7 +34,7 @@ <field name="model">wiki.groups</field> <field name="type">form</field> <field name="arch" type="xml"> - <form string="Wikis"> + <form string="Wiki Groups"> <group colspan="4" col="4"> <field name="name" select="1"/> <field name="create_date" readonly="2"/> @@ -62,7 +62,7 @@ <!-- Wiki Groups Action --> <record model="ir.actions.act_window" id="action_wiki_groups"> - <field name="name">Wikis</field> + <field name="name">Wiki Groups</field> <field name="res_model">wiki.groups</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> @@ -74,7 +74,7 @@ action="action_wiki_groups"/> <record model="ir.actions.act_window" id="action_wiki_groups_browse"> - <field name="name">Wikis</field> + <field name="name">Wiki Groups</field> <field name="res_model">wiki.groups</field> <field name="view_type">tree</field> </record> @@ -126,13 +126,15 @@ <form string="Wiki"> <group col="8" colspan="4"> <field name="name" select="1" colspan="6"/> + <button name="open_wiki_page" type="object" + string="Basic Wiki Editing" icon="gtk-ok" /> + </group> + <group col="8" colspan="4"> <field name="group_id" select="1" on_change="onchange_group_id(group_id, text_area)"/> <field name="section" invisible="not context.get('section',False)"/> <field name="parent_id"/> - <button name="open_wiki_page" type="object" - string="Basic Wiki Editing" icon="gtk-ok" /> </group> - + <separator colspan="4" string="Informations"/> <field name="text_area" nolabel="1" colspan="4" select="1" widget="text_wiki"/> <separator colspan="4" string="Modifications"/> <group col="6" colspan="4"> @@ -169,7 +171,7 @@ <!-- search page for wiki --> <record model="ir.actions.act_window" id="action_wiki"> - <field name="name">Search Pages</field> + <field name="name">Wiki Pages</field> <field name="res_model">wiki.wiki</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> diff --git a/addons/wiki_sale_faq/__init__.py b/addons/wiki_sale_faq/__init__.py new file mode 100644 index 00000000000..938f045b9fd --- /dev/null +++ b/addons/wiki_sale_faq/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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/>. +# +############################################################################## + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki_sale_faq/__openerp__.py b/addons/wiki_sale_faq/__openerp__.py new file mode 100644 index 00000000000..9619ec98f15 --- /dev/null +++ b/addons/wiki_sale_faq/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +{ + 'name': 'Wiki -Sale - FAQ', + 'version': '1.0', + 'category': 'Generic Modules/Others', + 'description': """This module provides a wiki FAQ Template + """, + 'author': 'Tiny', + 'website': 'http://openerp.com', + 'depends': ['wiki_faq','document','crm'], + 'init_xml': [ + 'wiki_sale_faq_data.xml' + ], + 'update_xml': [ + 'wiki_sale_faq_view.xml' + ], + 'demo_xml': [ + ], + 'installable': True, + 'active': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki_sale_faq/wiki_sale_faq_data.xml b/addons/wiki_sale_faq/wiki_sale_faq_data.xml new file mode 100644 index 00000000000..4a8eea1cb38 --- /dev/null +++ b/addons/wiki_sale_faq/wiki_sale_faq_data.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data noupdate="1"> + <record model="document.directory" id="dir_sale"> + <field name="name">Sales Document</field> + <field name="user_id" ref="base.user_admin"/> + <field name="parent_id" ref="document.dir_root"/> + <field name="ressource_id">0</field> + </record> + + <record id="wiki_groups_sale_faq" model="wiki.groups"> + <field name="name">Sale FAQ</field> + <field name="method">list</field> + <field eval="2" name="section"/> + <field name="template">== Question == + +== Answer == + +== External Links == + + </field> + </record> + + + </data> +</openerp> diff --git a/addons/wiki_sale_faq/wiki_sale_faq_view.xml b/addons/wiki_sale_faq/wiki_sale_faq_view.xml new file mode 100644 index 00000000000..c3643bdf049 --- /dev/null +++ b/addons/wiki_sale_faq/wiki_sale_faq_view.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<openerp> + <data> + <menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="1"/> + + <menuitem name="Documents" + id="menu_sales" sequence="6" + parent="base.menu_base_partner"/> + + <record model="ir.actions.act_window" id="action_document_form"> + <field name="type">ir.actions.act_window</field> + <field name="res_model">ir.attachment</field> + <field name="view_type">form</field> + <field name="domain" eval="[('parent_id','=',ref('dir_sale'))]"></field> + </record> + + <record model="ir.actions.act_window" id="action_wiki_test"> + <field name="name">Wiki Pages</field> + <field name="res_model">wiki.wiki</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + <field name="domain" eval="[('group_id','=',ref('wiki_groups_sale_faq'))]"/> + <field name="search_view_id" ref="wiki.view_wiki_filter"/> + </record> + + <menuitem + name="Documents" + action="action_document_form" + id="menu_document_files" + parent="menu_sales"/> + + <menuitem parent="menu_sales" + id="menu_action_wiki_wiki" name="FAQ" + action="action_wiki_test" /> + + + </data> +</openerp> |
