コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2187 ビュー

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

アバター
破棄
最善の回答

Update the field definition in stock.picking model like this


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


アバター
破棄
著作者 最善の回答

Can we do it using overriding?

アバター
破棄
関連投稿 返信 ビュー 活動
3
2月 25
3499
0
5月 24
46
1
4月 24
3328
1
12月 23
2482
0
11月 23
1199