Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


No changes For fields After Write Method

Ali Abdelmonem Mustafa Amer
on 2/24/14, 3:51 AM 657 views

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.

on 2/24/14, 10:28 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 2/24/14, 3:51 AM
Seen: 657 times
Last updated: 3/16/15, 8:10 AM