From c7166b7fdb29ac98bc8bdffe8f3f15f8fef5134c Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Fri, 2 Mar 2012 12:17:09 +0530 Subject: [PATCH] [FIX]Sale:Simplify the picking and the invoice policy on Sale order edit order policy and set invoice on as per needed bzr revid: sgo@tinyerp.com-20120302064709-430idkcoq18t6q4x --- addons/sale/__openerp__.py | 2 +- addons/sale/sale.py | 18 ++++++++---------- addons/sale/sale_demo.xml | 8 ++++---- addons/sale/sale_view.xml | 2 +- addons/sale/sale_workflow.xml | 2 +- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index ff2cfb03f5f..04a9d1a2ef6 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -91,7 +91,7 @@ Dashboard for Sales Manager that includes: 'test/sale_order_demo.yml', 'test/picking_order_policy.yml', 'test/manual_order_policy.yml', - 'test/postpaid_order_policy.yml', + #'test/postpaid_order_policy.yml', 'test/prepaid_order_policy.yml', 'test/cancel_order.yml', 'test/delete_order.yml', diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 82bfda7b580..3274781a9f7 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -223,16 +223,14 @@ class sale_order(osv.osv): 'picking_policy': fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], 'Picking Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""), 'order_policy': fields.selection([ - ('prepaid', 'Pay before delivery'), - ('manual', 'Deliver & invoice on demand'), - ('picking', 'Invoice based on deliveries'), - ('postpaid', 'Invoice on order after delivery'), - ], 'Invoice Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, - help="""The Invoice Policy is used to synchronise invoice and delivery operations. - - The 'Pay before delivery' choice will first generate the invoice and then generate the picking order after the payment of this invoice. - - The 'Deliver & Invoice on demand' will create the picking order directly and wait for the user to manually click on the 'Invoice' button to generate the draft invoice based on the sale order or the sale order lines. - - The 'Invoice on order after delivery' choice will generate the draft invoice based on sales order after all picking lists have been finished. - - The 'Invoice based on deliveries' choice is used to create an invoice during the picking process."""), + ('prepaid', 'Before Delivery'), + ('manual', 'On Demand'), + ('picking', 'On Delivery Order'), + ], 'Create Invoice', required=True, readonly=True, states={'draft': [('readonly', False)]}, + help="""The Create Invoice is used to synchronise invoice and delivery operations. + - The 'Before Delivery' choice will first generate the invoice and then generate the picking order after the payment of this invoice. + - The 'On Demand' will create the picking order directly and wait for the user to manually click on the 'Invoice' button to generate the draft invoice based on the sale order or the sale order lines. + - The 'On Delivery Order' choice will generate the draft invoice based on sales order after all picking lists have been finished."""), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Pricelist for current sales order."), 'project_id': fields.many2one('account.analytic.account', 'Contract/Analytic Account', readonly=True, states={'draft': [('readonly', False)]}, help="The analytic account related to a sales order."), diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index 5da496a1c4b..3b5c4c46b3a 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -61,7 +61,7 @@ - + - + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 90d3838f5a0..e26e3d34560 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -222,7 +222,7 @@ - + diff --git a/addons/sale/sale_workflow.xml b/addons/sale/sale_workflow.xml index 0ff5eb15ea0..78284ee1eb1 100644 --- a/addons/sale/sale_workflow.xml +++ b/addons/sale/sale_workflow.xml @@ -172,7 +172,7 @@ - (order_policy=='prepaid') or ((order_policy=='postpaid') and shipped) + (order_policy=='prepaid')