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

Hi, Can someone help me please?

I have two models created:

Model A: Loan

           payments_id = fields.One2Many('loan.payments', 'loan_id', 'Payments')

Model B: Loan Payments

            loan_id = fields.Many2One('loan', 'Loan')


Loan Description: XXXYYYZZZ

Loan Amount = 400.000

Description

Capitalization
(First row is equal to LOAN AMOUNT)

Principal
Interest

Payment
(Principal + interest)

Next Amount
( Capitalization - Principal )

1
400.000
20.000
20
20.020
380.000
2
380.000
20.000
20
20.020
360.000
3
360.000
20.000
20
20.02
340.000
I have a problem, how can I get the value 'Next Amount Capitalization' and store it in the next row or record of the one2many field? Thank you



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

Use onchange function on that one2many (payments_id)  field . It will definitely work.

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

I think onchange is not work.

Instead of creating one2many by using add an item, keep a button on header.

onclick this button create one2many lines.

I hope your problem will solve with this.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 25
1885
2
thg 9 22
9630
2
thg 4 22
4678
0
thg 7 21
7314
1
thg 3 21
5051