from odoo import models, fields, api
from odoo.addons import decimal_precision as dp
class AccountInvoiceSumLine(models.Model):
_name = 'account.invoice.sum.line'
_description = 'Account Invoice Sum Line'
account_move_id = fields.Many2one('account.move', string="Move ID")
product_id = fields.Many2one('product.product', string="Product")
product_uom_qty = fields.Float(string="Ordered Quantity", digits=dp.get_precision('Product Unit of Measure'))
uom_id = fields.Many2one('uom.uom', string="Unit of Measure", related='product_id.uom_id')
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Dự án
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
83
Lượt xem
Hi,
In Odoo 19, float precision is handled directly through the digits attribute on fields, not via dp.get_precision().
The fix is to remove the decimal_precision import and define the precision as digits="Product Unit of Measure" on the field. This is an expected breaking change during migration to Odoo 19.
Try the code below.
product_uom_qty = fields.Float(
string="Ordered Quantity",
digits="Product Unit of Measure"
)
Hope it helps
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
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 | |
|---|---|---|---|---|
|
|
3
thg 11 25
|
571 | ||
|
|
4
thg 11 25
|
600 | ||
|
|
0
thg 7 23
|
5 | ||
|
Odoo12 babel error
Đã xử lý
|
|
1
thg 11 19
|
8193 | |
|
|
1
thg 3 15
|
5253 |
What about this import? Is it deprecated? What Can I Replace this Import? Is it no need?