class Order_Line(models.Model):
_name = 'orderline.data'
_description = "Oder details"
product_name = fields.Selection(string="Product Name",
selection=[('chain', 'Chain'), ('nackless', 'Nackless'), ('har', 'Har'),
('churi', 'Churi'), ('yearring', 'Year-Ring')], required=True, )
weight = fields.Float(string="Weight", required=True)
product_image = fields.Image(string="Image")
product_quantity = fields.Integer(string="Quantity", required=True)
making_cost = fields.Integer(string="Making cost", )
gold_rate = fields.Float(string="Gold Rate", required=True, )
sub_total_price = fields.Float(string="Sub Total Price", compute='gold_cost_count', readonly="1")
create_orderline = fields.Many2one('order.order', string="Oder Line")
class PaymentLine(models.Model):
_name = 'paymentline.data'
_description = "Payment Details"
total_price = fields.Integer(string="Total Price")
advance_payment = fields.Integer(string="Advance payment")
total_due = fields.Float(string="Total Due")
create_paymentline = fields.Many2one('order.order', string="Payment Line")
I want to ist model field "sub_total_price" is value will be stored automatically in 2nd model field "total_price"
Can you kindly help me
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
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
2169
Lượt xem
Hi
You need to add a related field in 2nd model (paymentline.data)
like , order_data_id = fields.Many2one('orderline.data', string="OrderLine Data")
after adding the field you can use the related parameter in the total field
total_price = fields.Integer(string="Total Price", related='order_data_id.sub_total_price')
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 | |
---|---|---|---|---|
|
2
thg 3 15
|
9444 | ||
|
1
thg 3 15
|
3925 | ||
|
2
thg 2 25
|
1009 | ||
|
0
thg 5 24
|
1361 | ||
|
1
thg 8 23
|
4265 |