[FIX] UOM is added in change quantity notification in product and UI of threadview is modified.
bzr revid: bth@tinyerp.com-20120307130713-d9qp1ms3oajj40zk
This commit is contained in:
@@ -410,7 +410,7 @@
|
||||
<field colspan="4" name="property_ids" nolabel="1" groups="base.group_extended"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="message_ids_social" widget="ThreadView"/>
|
||||
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -782,7 +782,7 @@
|
||||
<field name="move_prod_id" groups="base.group_extended"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="message_ids_social" widget="ThreadView"/>
|
||||
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="message_ids_social" widget="ThreadView"/>
|
||||
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="message_ids_social" widget="ThreadView"/>
|
||||
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -105,12 +105,17 @@ class stock_change_product_qty(osv.osv_memory):
|
||||
def quantity_change_notification (self, cr, uid, ids, context=None):
|
||||
prod_obj = self.pool.get('product.product')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
prod_temp_obj = self.pool.get('product.template')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
|
||||
for data in self.browse(cr, uid, ids, context=context):
|
||||
for location in location_obj.browse(cr, uid, [data.location_id.id], context=context):
|
||||
location_name = location.name
|
||||
for prod in prod_obj.browse(cr, uid, [data.product_id.id], context=context):
|
||||
message = _("<b>Quantity is changed</b> to <em>%s</em> for <em>%s</em> location.") % (data.new_quantity,location_name)
|
||||
prod_obj.message_append_note(cr, uid, [prod.id], '', message)
|
||||
for prod_temp in prod_temp_obj.browse(cr, uid, [prod.product_tmpl_id.id], context=context):
|
||||
for uom in uom_obj.browse(cr, uid, [prod_temp.uom_id.id], context=context):
|
||||
message = _("<b>Quantity is changed</b> to <em>%s %s </em> for <em>%s</em> location.") % (data.new_quantity,uom.name,location_name)
|
||||
prod_obj.message_append_note(cr, uid, [prod.id], '', message)
|
||||
|
||||
stock_change_product_qty()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user