Hello,
How to set default value from function for fields Date in V8?
Thank You
For example:
@api.model
def _default_date(self):
inv_type = self._context.get('type', 'out_invoice')
if inv_type == 'out_invoice':
current_date = time.strftime(DEFAULT_SERVER_DATE_FORMAT)
return current_date
date_invoice = fields.Date(string='Invoice Date',readonly=True, states={'draft': [('readonly', False)]}, index=True, help="Keep empty to use the current date", copy=False, default=_default_date)
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
2
Sep 21
|
8479 | |||
|
1
Jun 20
|
5718 | |||
|
1
Des 25
|
6410 | |||
|
3
Jul 25
|
10411 | |||
|
1
Mei 25
|
2561 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
yes, it's works
Thanks zbik