Odoo Help

0

0
3 Answers
0
Sueb
2019/05/30 7:42
# -*- Coding: utf-8 -*-

from odoo import fields, api, models

class StockMoves(models.Model):
_inherit = 'stock.move'

@api.multi
def action_done(self):
pickings = self.env['stock.picking'].search([('partner_id', '=', self.partner_id.id)], order='date_done desc', limit=1)
print type(pickings)
for picking in pickings:
print (picking.partner_id.last_delivery_date)
picking.partner_id.write({'last_delivery_date': fields.Datetime.now()})
res = super(StockMoves, self).action_done()
return res

Ask a Question
Writer
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now