From 3717146dc47e2a36369917c2014c63199e51d96a Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Thu, 29 Nov 2012 19:10:18 +0530 Subject: [PATCH 1/7] [IMP] Channel_id and type field displayed if marketing module installed and in lead form reffered field put inside Misc section. bzr revid: bth@tinyerp.com-20121129134018-jpo0huhe4ca87466 --- addons/crm/crm_lead_view.xml | 12 ++++-------- addons/marketing/__openerp__.py | 2 +- addons/marketing/marketing_view.xml | 28 +++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 88b2edcd665..5986dcb934b 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -210,14 +210,15 @@ - - - + + + + @@ -496,11 +497,6 @@ - - - - - diff --git a/addons/marketing/__openerp__.py b/addons/marketing/__openerp__.py index 0c77fe59a86..e46c58b9959 100644 --- a/addons/marketing/__openerp__.py +++ b/addons/marketing/__openerp__.py @@ -23,7 +23,7 @@ { 'name': 'Marketing', 'version': '1.1', - 'depends': ['base', 'base_setup'], + 'depends': ['base', 'base_setup', 'crm'], 'author': 'OpenERP SA', 'category': 'Hidden/Dependency', 'description': """ diff --git a/addons/marketing/marketing_view.xml b/addons/marketing/marketing_view.xml index 965818cf65e..f6753e733cd 100644 --- a/addons/marketing/marketing_view.xml +++ b/addons/marketing/marketing_view.xml @@ -7,6 +7,32 @@ id="base.marketing_menu" groups="marketing.group_marketing_user,marketing.group_marketing_manager" sequence="85"/> - + + crm.lead.inherit.form + crm.lead + + + + Marketing + + + + + + + + + crm.lead.inherit.form + crm.lead + + + + + + + + + + From c468fbedff0f46b64048c092afe46919e97dd270 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 30 Nov 2012 16:33:32 +0530 Subject: [PATCH 2/7] [IMP] Set priority and when no any data in listview then display message with arrow message. bzr revid: bth@tinyerp.com-20121130110332-fq30b3174e0kfu33 --- .../analytic_contract_hr_expense.py | 24 +++++++++---------- addons/hr_expense/hr_expense_view.xml | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py index ee92b469744..7bb0987600f 100644 --- a/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py +++ b/addons/analytic_contract_hr_expense/analytic_contract_hr_expense.py @@ -113,20 +113,20 @@ class account_analytic_account(osv.osv): return res def open_hr_expense(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + act_obj = self.pool.get('ir.actions.act_window') + + result = mod_obj.get_object_reference(cr, uid, 'hr_expense', 'expense_all') + id = result and result[1] or False + result = act_obj.read(cr, uid, [id], context=context)[0] + line_ids = self.pool.get('hr.expense.line').search(cr,uid,[('analytic_account', 'in', ids)]) - domain = [('line_ids', 'in', line_ids)] + result['domain'] = [('line_ids', 'in', line_ids)] names = [record.name for record in self.browse(cr, uid, ids, context=context)] - name = _('Expenses of %s') % ','.join(names) - return { - 'type': 'ir.actions.act_window', - 'name': name, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'context':{'analytic_account':ids[0]}, - 'domain' : domain, - 'res_model': 'hr.expense.expense', - 'nodestroy': True, - } + result['name'] = _('Expenses of %s') % ','.join(names) + result['context'] = {'analytic_account':ids[0]} + result['view_type'] = 'form' + return result def hr_to_invoice_expense(self, cr, uid, ids, context=None): domain = [('invoice_id','=',False),('to_invoice','!=',False), ('journal_id.type', '=', 'purchase'), ('account_id', 'in', ids)] diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index e457aa505ef..2c206589ac2 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -58,15 +58,16 @@ hr.expense.form hr.expense.expense +
From 942eb82890f522abc04e5276f6c728eb31848c83 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 7 Dec 2012 12:49:10 +0530 Subject: [PATCH 3/7] [IMP] Give todays'date in default. bzr revid: bth@tinyerp.com-20121207071910-p87eady1aiicguy2 --- addons/account/account_invoice.py | 2 ++ addons/sale/wizard/sale_make_invoice.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index ec8dd677527..fbe6f12a4cd 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -22,6 +22,7 @@ import time from lxml import etree import decimal_precision as dp +from datetime import datetime import netsvc import pooler @@ -289,6 +290,7 @@ class account_invoice(osv.osv): 'internal_number': False, 'user_id': lambda s, cr, u, c: u, 'sent': False, + 'date_invoice': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S') } _sql_constraints = [ ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), diff --git a/addons/sale/wizard/sale_make_invoice.py b/addons/sale/wizard/sale_make_invoice.py index c874323e2b8..eb54d447013 100644 --- a/addons/sale/wizard/sale_make_invoice.py +++ b/addons/sale/wizard/sale_make_invoice.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ import netsvc +from datetime import datetime class sale_make_invoice(osv.osv_memory): _name = "sale.make.invoice" @@ -30,7 +31,8 @@ class sale_make_invoice(osv.osv_memory): 'invoice_date': fields.date('Invoice Date'), } _defaults = { - 'grouped': False + 'grouped': False, + 'invoice_date': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S') } def view_init(self, cr, uid, fields_list, context=None): From 7a81c5e8ca933e631dd70454f33715b3226c8f0d Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 7 Dec 2012 12:52:21 +0530 Subject: [PATCH 4/7] [IMP] Put condition on group. bzr revid: bth@tinyerp.com-20121207072221-f747xnt4s3hh9l46 --- addons/crm/crm_lead_view.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 094fd3663da..98e11dee646 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -206,9 +206,8 @@ - + From 5580c1895815d3e4aca81f2c46a6554adc102ccb Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 7 Dec 2012 14:26:18 +0530 Subject: [PATCH 5/7] [FIX] Remove unnecessary code. bzr revid: bth@tinyerp.com-20121207085618-ufjtw493a45qp0ot --- addons/account/account_invoice.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index fbe6f12a4cd..ec8dd677527 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -22,7 +22,6 @@ import time from lxml import etree import decimal_precision as dp -from datetime import datetime import netsvc import pooler @@ -290,7 +289,6 @@ class account_invoice(osv.osv): 'internal_number': False, 'user_id': lambda s, cr, u, c: u, 'sent': False, - 'date_invoice': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S') } _sql_constraints = [ ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), From 19091c5c59f8a9957e9907c771d8868da8d735f3 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 7 Dec 2012 14:55:55 +0530 Subject: [PATCH 6/7] [IMP] Name changed in context. bzr revid: bth@tinyerp.com-20121207092555-g4e29bgy3ac0cexp --- addons/sale/sale.py | 2 +- addons/sale/wizard/sale_make_invoice.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index ccd53c47b25..0c9499ed558 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -489,7 +489,7 @@ class sale_order(osv.osv): # If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the # last day of the last month as invoice date if date_inv: - context['date_inv'] = date_inv + context['date_invoice'] = date_inv for o in self.browse(cr, uid, ids, context=context): currency_id = o.pricelist_id.currency_id.id if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id): diff --git a/addons/sale/wizard/sale_make_invoice.py b/addons/sale/wizard/sale_make_invoice.py index eb54d447013..d19bbd65331 100644 --- a/addons/sale/wizard/sale_make_invoice.py +++ b/addons/sale/wizard/sale_make_invoice.py @@ -32,7 +32,7 @@ class sale_make_invoice(osv.osv_memory): } _defaults = { 'grouped': False, - 'invoice_date': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S') + 'invoice_date': lambda *a:datetime.now().strftime('%Y-%m-%d') } def view_init(self, cr, uid, fields_list, context=None): From 241bcfe85de67f05b9c8f62217de64b9cce24944 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 10 Dec 2012 16:21:48 +0530 Subject: [PATCH 7/7] [IMP]: sale: Set current date as invoice date while creating invoice from SO lines bzr revid: rpa@tinyerp.com-20121210105148-0vaen7se7o7dh6fd --- addons/sale/wizard/sale_line_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 54001f645c8..8b2a31ff101 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -22,6 +22,7 @@ from osv import osv from tools.translate import _ import netsvc +from datetime import datetime class sale_order_line_make_invoice(osv.osv_memory): _name = "sale.order.line.make.invoice" @@ -72,7 +73,8 @@ class sale_order_line_make_invoice(osv.osv_memory): 'payment_term': pay_term, 'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id, 'user_id': order.user_id and order.user_id.id or False, - 'company_id': order.company_id and order.company_id.id or False + 'company_id': order.company_id and order.company_id.id or False, + 'date_invoice': datetime.now().strftime('%Y-%m-%d') } inv_id = self.pool.get('account.invoice').create(cr, uid, inv) return inv_id