Remove code... it was native !
This commit is contained in:
@@ -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.
|
||||||
""",
|
""",
|
||||||
|
|||||||
@@ -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)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user