← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3

 

mtr(OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
Related bugs:
  #588220 Cancelling sale order should affect Procurements,production orders
  https://bugs.launchpad.net/bugs/588220
  #600534 Invoices don't always enforce the UoM category
  https://bugs.launchpad.net/bugs/600534
  #600547 Invoice totals not updated when a line is moved (store={...} bug?)
  https://bugs.launchpad.net/bugs/600547
  #690895 copy account.move crash 
  https://bugs.launchpad.net/bugs/690895


[FIX] Account:Gives warning when wrong UoM is selected in account invoice line" --fixes lp:600534 
-- 
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr1/+merge/44017
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account/invoice.py'
--- account/invoice.py	2010-12-17 04:37:32 +0000
+++ account/invoice.py	2010-12-17 09:23:56 +0000
@@ -1452,10 +1452,19 @@
 
     def uos_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
         res = self.product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
+        warning = {}
         if 'uos_id' in res['value']:
             del res['value']['uos_id']
         if not uom:
             res['value']['price_unit'] = 0.0
+        prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
+        u = self.pool.get('product.uom').browse(cr, uid, uom, context=context)
+        if prod.uom_id.category_id.id != u.category_id.id:
+             warning = {
+                'title': _('Wrong UoM !'),
+                'message': _('Select correct UoM for your product.') 
+            }
+             return {'warning': warning}
         return res
 
     def move_line_get(self, cr, uid, invoice_id, context=None):


Follow ups