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