Skip to Content
Menu
This question has been flagged

Haii , i'm a beginner in technical odoo and python.

i was create a new module, i'm totally copied the code from another module basicly similiar like my module , and i stuck in calculate subtotal, this is my code :

def create(self, cr, uid, vals, context=None):

if not vals['work_lines'] :

raise osv.except_osv(('Perhatian !'), ("Detail Transaksi Belum di Isi"))

vals['date'] = time.strftime('%Y-%m-%d')

self._get_wo(cr, uid, vals['branch_id'], vals ['type'],vals['date'],vals['tanggal_pembelian'],vals['kpb_ke'])

vals['name'] = self.pool.get('ir.sequence').get_per_branch(cr, uid, vals['branch_id'], 'WO')

work_order = super(pesan_service, self).create(cr, uid, vals, context=context)

if work_order:

obj_lot = self.pool.get('stock.production.lot')

lot_update_reserve = obj_lot.write(cr,uid,vals['lot_id'],{'no_polisi':vals['no_pol'],'product_id':vals['product_id']})

return work_order


i want to remove lot_it , because i not use it in my new module. how to changes it into branch_id maybe ?

if i change it i get an error code who was reference with lot_id but if i not change it i get Key Error : Lot_id
Please help me to fix it , Thanks

Avatar
Discard
Related Posts Replies Views Activity
3
Dec 22
9952
5
Apr 24
39351
6
Apr 24
36752
3
Mar 24
9220
2
Jul 19
765