diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index d8e9d0fef6f..de9615dea11 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -29,7 +29,7 @@ class sale_configuration(osv.osv_memory): _columns = { 'group_invoice_so_lines': fields.boolean('Generate invoices based on the sale order lines', implied_group='sale.group_invoice_so_lines', - help="To allow your salesman to make invoices for sale order lines using the menu 'Lines to Invoice'."), + help="To allow your salesman to make invoices for sale order lines using the menu 'Order Lines to Invoice'."), 'timesheet': fields.boolean('Prepare invoices based on timesheets', help = """For modifying account analytic view to show important data to project manager of services companies. You can also view the report of account analytic summary user-wise as well as month wise. diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 419047dbbd2..f5b98b36ed0 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -466,7 +466,7 @@
diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index f442cbe0a8e..4caace0f9bf 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -109,9 +109,30 @@ class sale_order_line_make_invoice(osv.osv_memory): if not invoices: raise osv.except_osv(_('Warning!'), _('Invoice cannot be created for this Sales Order Line due to one of the following reasons:\n1.The state of this sales order line is either "draft" or "cancel"!\n2.The Sales Order Line is Invoiced!')) - + if context.get('open_invoices', False): + return self.open_invoices( cr, uid, ids, res, context=context) return {'type': 'ir.actions.act_window_close'} + def open_invoices(self, cr, uid, ids, invoice_ids, context=None): + """ open a view on one of the given invoice_ids """ + ir_model_data = self.pool.get('ir.model.data') + form_res = ir_model_data.get_object_reference(cr, uid, 'account', 'invoice_form') + form_id = form_res and form_res[1] or False + tree_res = ir_model_data.get_object_reference(cr, uid, 'account', 'invoice_tree') + tree_id = tree_res and tree_res[1] or False + + return { + 'name': _('Advance Invoice'), + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'account.invoice', + 'res_id': invoice_ids, + 'view_id': False, + 'views': [(form_id, 'form'), (tree_id, 'tree')], + 'context': {'type': 'out_invoice'}, + 'type': 'ir.actions.act_window', + } + sale_order_line_make_invoice() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/wizard/sale_line_invoice.xml b/addons/sale/wizard/sale_line_invoice.xml index 2eb5d1ae47f..6144ff489f4 100644 --- a/addons/sale/wizard/sale_line_invoice.xml +++ b/addons/sale/wizard/sale_line_invoice.xml @@ -7,11 +7,19 @@
+ +
+

+ All items in these order lines will be invoiced. You can also invoice a percentage of the sale order + or a fixed price (for advances) directly from the sale order form if you prefer. +

+
diff --git a/addons/sale_stock/__openerp__.py b/addons/sale_stock/__openerp__.py index 10773b44a3f..a849df295d4 100644 --- a/addons/sale_stock/__openerp__.py +++ b/addons/sale_stock/__openerp__.py @@ -52,6 +52,7 @@ You can choose flexible invoicing methods: 'company_view.xml', 'sale_stock_view.xml', 'sale_stock_workflow.xml', + 'stock_view.xml', 'res_config_view.xml', 'report/sale_report_view.xml', 'process/sale_stock_process.xml',