Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4814 Lượt xem

Hello, Iam trying this to call onchange in account invoice state field

from openerp import models, fields, api 
import logging
_logger = logging.getLogger(__name__)

class invoice(models.Model):
_inherit = 'account.invoice'

@api.onchange('state')
 def _check_onchange_invoice_state(self): 
_logger.info('=======================================================')
_logger.info(self.id)
_logger.info('=======================================================')

I now this field have "track_visibility" and I don't know if I can used or not but I really need it. Any help?

I also try @api.onchange('write_date') but nothing happens :(.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I recommend you to read the documentation of api@onchange and api@depend.
https://www.odoo.com/documentation/12.0/reference/orm.html#module-odoo.api
In both cases, you should probably use api@depends

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 16
5336
2
thg 3 15
5246
1
thg 7 19
3240
2
thg 11 16
5956
1
thg 9 16
7906