K.ju
K.ju

Reputation: 593

Difference between Invoice Lines and Journal Items in Odoo 14

I overrided write and create functions in model : 'account.move.line' I only want to browse the lines of Invoice Lines. How to distinguish between Invoice Lines and Journal Items in self? Thanks.

@api.model
    def write(self, vals):
        res = super(AccountMoveLine, self).write(vals)
            for line in self:
               ...

Upvotes: 2

Views: 1003

Answers (1)

Bhavesh Odedra
Bhavesh Odedra

Reputation: 11143

In account.move has type selection field. If it has value entry then Odoo treats as a Journal entry. And if it has value other then entry, Odoo treats as a Invoice / Credit Note / Refund.

In account.move.line has type_name computed field, which set value according account.move type value.

Upvotes: 2

Related Questions