Skip to Content
Menu
This question has been flagged

I added a custom field in "account.payment" model, I also added it in "account.move.line" model (aka: Journal Item). 

The value of the custom field is entered from account.payment and since the journal items are generated from a payment creation  I want to do the following:

If account.move.line.id is created by account.payment.id    
    let account.move.line.custom_field = account.payment.custom_field 
I appreciate your help
Avatar
Discard
Best Answer

Hello
into account.move.line object add like this.

custom_field = fields.Char(related="payment_id.custom_field", string="String")

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 24
612
1
Nov 22
1737
2
Aug 22
5986
1
Nov 21
7406
1
Sep 21
5008