Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2196 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

Can we do it using overriding?

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
feb 25
3507
0
mag 24
46
1
apr 24
3331
1
dic 23
2490
0
nov 23
1200