Skip to Content
Menu
This question has been flagged
1 Reply
3158 Views

I want to get default value from  date invoice but not succes, Thanks for your answer

My code is:

@api.depends('date_invoice')
def _default_date(self):
   self.tanggal = self.date_invoice

tanggal = fields.Date(
  string='Tanggal', default=lambda self:self._default_date, readonly=False)
Avatar
Discard
Best Answer

Hi awar,

Use related fields !

tanggal = fields.Date(string='Tanggal', related='date_invoice', readonly=False)

Avatar
Discard