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..5b23761294b 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,19 @@ 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') + + dummy, act_window_id = mod_obj.get_object_reference(cr, uid, 'hr_expense', 'expense_all') + result = act_obj.read(cr, uid, act_window_id, context=context) + line_ids = self.pool.get('hr.expense.line').search(cr,uid,[('analytic_account', 'in', ids)]) - 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['domain'] = [('line_ids', 'in', line_ids)] + names = [account.name for account in self.browse(cr, uid, ids, context=context)] + 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/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index ce5d4555028..a15edf9f2e2 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -173,18 +173,19 @@ - + - - - + + + + @@ -463,12 +464,7 @@ - - - - - - + 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 +
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..da83c857f9b 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 + + + + + + + + + + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8bab265ae3b..f2c4f694a27 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_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 54001f645c8..f71ed621247 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -72,7 +72,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': fields.date.today(cr, uid, context=context), } inv_id = self.pool.get('account.invoice').create(cr, uid, inv) return inv_id diff --git a/addons/sale/wizard/sale_make_invoice.py b/addons/sale/wizard/sale_make_invoice.py index c874323e2b8..1a20474b659 100644 --- a/addons/sale/wizard/sale_make_invoice.py +++ b/addons/sale/wizard/sale_make_invoice.py @@ -30,7 +30,8 @@ class sale_make_invoice(osv.osv_memory): 'invoice_date': fields.date('Invoice Date'), } _defaults = { - 'grouped': False + 'grouped': False, + 'invoice_date': fields.date.context_today, } def view_init(self, cr, uid, fields_list, context=None):