Remove code... it was native !

This commit is contained in:
Alexis de Lattre
2014-04-09 12:13:58 +02:00
parent 3ee3edb8ce
commit 5075221428
2 changed files with 5 additions and 13 deletions

View File

@@ -26,12 +26,12 @@
'version': '0.1', 'version': '0.1',
'category': 'Sales Management', 'category': 'Sales Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': "Order Policy = 'On Delivery Order' by default, switches to 'On Demand' when service-only", 'summary': "Order Policy = 'On Delivery Order' by default",
'description': """ 'description': """
Sale Auto Order Policy Sale Auto Order Policy
====================== ======================
With this module, the Order Policy on Quotations is set to 'On Delivery Order' by default. If the Quotation only contains service lines, the Order Policy is switched to 'On Demand' when the Quotation is confirmed. With this module, the Order Policy on Quotations is set to 'On Delivery Order' by default. If the Quotation only contains service lines, the Order Policy is switched to 'On Demand' when the Quotation is confirmed (native feature).
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module. Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
""", """,

View File

@@ -30,14 +30,6 @@ class sale_order(orm.Model):
'order_policy': 'picking', 'order_policy': 'picking',
} }
def action_button_confirm(self, cr, uid, ids, context=None): # The function action_wait in sale_stock/sale_stock.py line 224
assert len(ids) == 1, 'Only one ID' # ensures that the order_policy switches to 'manual' when
so = self.browse(cr, uid, ids[0], context=context) # we only have services in the order
service_only = True
for line in so.order_line:
if line.product_id and line.product_id.type != 'service':
service_only = False
if service_only:
so.write({'order_policy': 'manual'})
return super(sale_order, self).action_button_confirm(
cr, uid, ids, context=context)