c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #21874
Re: [Bug 759444] Re: Sale module: only the last warning is displayed
Hi Amit Parik,
in sale.py / product_id_change() function
If a product is not on stock, you should receive a warning:
warning = {
'title': _('Not enough stock !'),
'message': _('You plan to sell %.2f %s but you only have
%.2f %s available !\nThe real stock is %.2f %s. (without reservations)')
%
(qty, uom2 and uom2.name or product_obj.uom_id.name,
max(0,product_obj.virtual_available),
product_obj.uom_id.name,
max(0,product_obj.qty_available),
product_obj.uom_id.name)
}
If the packaging is incorrect you receive another one:
warn_msg = _("You selected a quantity of %d Units.\n"
"But it's not compatible with the selected
packaging.\n"
"Here is a proposition of quantities
according to the packaging:\n\n"
"EAN: %s Quantity: %s Type of ul: %s") % \
(qty, ean, qty_pack, type_ul.name)
If the price list is not in:
if not pricelist:
warning = {
'title': 'No Pricelist !',
'message':
'You have to select a pricelist or a customer in the
sales form !\n'
'Please set one before choosing a product.'
}
If the price is not correct:
warning = {
'title': 'No valid pricelist line found !',
'message':
"Couldn't find a pricelist line matching this
product and quantity.\n"
"You have to change either the product, the
quantity or the pricelist."
}
nevertheless if you have 2 or more of the above conditions fulfilled,
you only receive the last warning since they are not cumulative.
Hope this is clearer.
--
Eric
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/759444
Title:
Sale module: only the last warning is displayed
Status in OpenERP Modules (addons):
Incomplete
Bug description:
In product_id_change, if several warnings are raised (eg: packaging +
stock + price), only the last one is passed as a result and displayed.
References