Skip to Content
Menu
This question has been flagged
2 Replies
1197 Views

I have inherited and added a date fields in the sales form and delivery form. I need to update the date in the delivery form as I update it in the sales order form by confirming it. How can I do this in odoo 15.

from odoo import api, fields, models, _, exceptions
from datetime import date, datetime


class SaleInheritance(models.Model):
_inherit = "sale.order"
real_date = fields.Date(string='Real date')


class StockPicking(models.Model):
_inherit = "stock.picking"
real_date = fields.Date(string='Real_date')

here is my python code

Avatar
Discard
Best Answer

Update the field definition in stock.picking model like this


real_date = fields.Date(string='Real_date',related='sale_id.real_date',store=True)


Avatar
Discard
Author Best Answer

Can we do it using overriding?

Avatar
Discard
Related Posts Replies Views Activity
3
Apr 24
1020
0
May 24
46
1
Apr 24
1826
1
Dec 23
1000
0
Nov 23
450