From 9d2b79bb34079299316a47c7879c5a28e2ef5691 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Thu, 22 Nov 2012 14:52:14 +0530 Subject: [PATCH 1/5] [IMP]sale_stock:make visible menu Deliveries to Invoice while group_invoice_deli_orders field is true bzr revid: ssu@tinyerp.com-20121122092214-vzlfdtouria5mkv8 --- addons/sale_stock/__openerp__.py | 1 + 1 file changed, 1 insertion(+) 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', From 7ca3df80ecc2f488b5d4c8216ed73378ce3cd481 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Thu, 22 Nov 2012 15:00:42 +0530 Subject: [PATCH 2/5] [IMP]sale:updated help of field group_invoice_so_lines Lines to Invoice by Order Lines to Invoice bzr revid: ssu@tinyerp.com-20121122093042-svs17q7agvmsieqg --- addons/sale/res_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 7962dd0fef5d60a3eaed1cda4b6fb4b157a7bf13 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Thu, 22 Nov 2012 15:14:47 +0530 Subject: [PATCH 3/5] [IMP]sale:align Create Invoice button left side bzr revid: ssu@tinyerp.com-20121122094447-7d4025qkamy8ema2 --- addons/sale/sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@
From 16fe01be59b9e376464f09908c9d72ec3b607899 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Thu, 22 Nov 2012 17:12:44 +0530 Subject: [PATCH 4/5] [IMP]sale:put title on top with update and buttons in bottom of title and also added

bzr revid: ssu@tinyerp.com-20121122114244-my3fo0234n0ksig6 --- addons/sale/wizard/sale_line_invoice.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/sale/wizard/sale_line_invoice.xml b/addons/sale/wizard/sale_line_invoice.xml index 2eb5d1ae47f..49b93edb40d 100644 --- a/addons/sale/wizard/sale_line_invoice.xml +++ b/addons/sale/wizard/sale_line_invoice.xml @@ -7,11 +7,17 @@

+ +
+

+ 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. +

+
From eb9c03282cb17db7fb85d6905d39e1c3d2cc0203 Mon Sep 17 00:00:00 2001 From: Saurang Suthar Date: Fri, 23 Nov 2012 16:16:18 +0530 Subject: [PATCH 5/5] [IMP]sale:added new button Create & View Invoice for creating and view invoice bzr revid: ssu@tinyerp.com-20121123104618-jxs2vk8huakuptua --- addons/sale/wizard/sale_line_invoice.py | 23 ++++++++++++++++++++++- addons/sale/wizard/sale_line_invoice.xml | 2 ++ 2 files changed, 24 insertions(+), 1 deletion(-) 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 49b93edb40d..6144ff489f4 100644 --- a/addons/sale/wizard/sale_line_invoice.xml +++ b/addons/sale/wizard/sale_line_invoice.xml @@ -14,6 +14,8 @@ or a fixed price (for advances) directly from the sale order form if you prefer.