跳至内容
菜单
此问题已终结
3923 查看

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

形象
丢弃

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

相关帖文 回复 查看 活动
0
3月 15
3819
0
12月 17
5592
1
12月 16
4555
0
4月 15
186
1
3月 15
9268