i want to use removal_date in tree view
class StockProductionLot(models.Model):
_inherit = 'stock.production.lot'
removal_date = fields.Date()
Type of related field stock.quant.removal_date is inconsistent with stock.production.lot.removal_date
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i want to use removal_date in tree view
class StockProductionLot(models.Model):
_inherit = 'stock.production.lot'
removal_date = fields.Date()
Type of related field stock.quant.removal_date is inconsistent with stock.production.lot.removal_date
Hello
Actually the datatype of the field "removal_date" in stock.production.lot is datetime, and this field is referred as related fields in the stock.quant object.
ex :
class StockProductionLot(models.Model):
_inherit = 'stock.production.lot'
removal_date = fields.Datetime(string='Removal Date',
help='This is the date on which the goods with this Serial Number should be removed from the stock.')
class StockQuant(models.Model):
_inherit = 'stock.quant'
removal_date = fields.Datetime(related='lot_id.removal_date', store=True)
here the issue is you are changing the datatype from datetime to date in stock.production.lot, but not in stock.quant thats the issue,
if you include this change your code will work
class StockQuant(models.Model):
_inherit = 'stock.quant'
removal_date = fields.Date(related='lot_id.removal_date', store=True)
Thanks
thank you i am grateful
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
4
thg 4 20
|
8647 | ||
|
3
thg 10 19
|
7413 | ||
|
2
thg 2 18
|
13513 | ||
|
0
thg 1 18
|
8426 | ||
App is not appearing in the list
Đã xử lý
|
|
3
thg 6 24
|
3920 |