Reputation: 593
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
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