Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3918 Widoki

Hi All , I Tried To Use Write Method inside Button WorkFlow To Update filed In account.asset.asset Module But no Changes Happened For This Field

And This Is My Code

 def action_done(self, cr, uid, ids, context=None):
        mro_obj = self.pool.get('mro.order')
        for records_lines_time in mro_obj.browse(cr, uid, ids):
            Execution_date = records_lines_time.date_execution
            asset_ids = records_lines_time.asset_id
    assets_obj = self.pool.get('account.asset.asset')
    assets_obj.write(cr,uid,[asset_ids.id],{'last_fixing' : Execution_date},context=context)

    for order in self.browse(cr, uid, ids, context=context):
        self.pool.get('stock.move').action_done(cr, uid, [x.id for x in order.parts_move_lines])
    self.write(cr, uid, ids, {'state': 'done', 'date_execution': time.strftime('%Y-%m-%d %H:%M:%S')})
    return True

Please I Need Help

Thanks A Lot

Awatar
Odrzuć

Debug your code before write method print "asset_id", asset_ids.id If id prints write method update the records.

Powiązane posty Odpowiedzi Widoki Czynność
0
mar 15
3808
0
gru 17
5591
1
gru 16
4550
0
kwi 15
186
1
mar 15
9266