Odoo Help


Write problem [Closed]

Dr Obx
on 10/8/15, 6:08 AM 723 views

The Question has been closed for reason: not relevant or out dated

Dr Obx
on 10/08/2015 10:12:37

Guys, I my definition once I click on the "MOVE" button product should be taken off stock then state changed to 'done' and boolean field 'settled' changed to 'true'

but it doesn't work.

 def stock_move(self, cr, uid, ids, context=None):
 current_obj = self.browse(cr, uid, ids[0])
 product_to_move = current_obj.product_id.id
 source_location = current_obj.location_id.id
 destination_location = current_obj.location_dest_id.id
 quantity_to_move = current_obj.quantitymove_id = self.pool.get('stock.move').create(cr, uid, {'product_id': product_to_move,'location_id': source_location, 'location_dest_id': destination_location,'product_uom_qty': quantity_to_move, 'invoice_state': 'none','date_expected': datetime.now(), 'product_uom':current_obj.product_uom.id,'name': current_obj.product_id.name}) self.pool.get('stock.move').action_done(cr, uid, move_id, context=context)
# if I add this line =>
self.write({'order_state': 'done', 'settled': True})
# i'm getting an error  required 4 given 2 and don't know what to do with it
return True


Baiju KS

--Baiju KS--
| 5 5 8
Kochi, India
--Baiju KS--
ODOO technical

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju KS
On 10/8/15, 6:32 AM


You are using old api, so write method should be :-

self.write(cr, uid, ids, {'order_state': 'done', 'settled': True}, context=context)

Hope this help.

Works beautifully :) Thank you Baiju :)

Dr Obx
on 10/8/15, 9:33 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 10/8/15, 6:08 AM
Seen: 723 times
Last updated: 10/8/15, 10:12 AM