hi all ,
i am trying to replace the product_qty , with two other field , qty1 and qty2 . then if i do a new : incoming product or deliver product in warehouse menu
so : product_qty = qty1 + qty2 .
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
hi all ,
i am trying to replace the product_qty , with two other field , qty1 and qty2 . then if i do a new : incoming product or deliver product in warehouse menu
so : product_qty = qty1 + qty2 .
Hi ,
you can overwrite methode create and copy of stock.move
class stock_move(osv.osv):
    _inherit = 'stock.move'    
    _columns = {          
               'qty1': fields.float('Quantity 1 ', 
                digits_compute=dp.get_precision('Product Unit of Measure'),  
                'qty2': fields.float('Quantity 2', 
                 digits_compute=dp.get_precision('Product Unit of Measure'),                  
                 }   
    def create(self, cr, user, vals, context=None):
         product_qty=vals.get('qty1')+vals.get('qty2')
         vals['product_qty']=product_qty 
         return super(stock_move, self).create(cr, user, vals, context)
stock_move()
Thanks.
Create an account today to enjoy exclusive features and engage with our awesome community!
Prijavi| Related Posts | Odgovori | Prikazi | Aktivnost | |
|---|---|---|---|---|
|  | 0 mar. 15  | 4112 | ||
|  | 1 avg. 21  | 8123 | ||
|  | 2 mar. 21  | 5365 | ||
|  | 0 sep. 20  | 3704 | ||
|  | 2 jul. 20  | 8885 |