Tower: upload laundry_management 19.0.19.0.4 (via marketplace)
This commit is contained in:
21
addons/laundry_management/models/account_move.py
Normal file
21
addons/laundry_management/models/account_move.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
|
class AccountMoveLaundryExt(models.Model):
|
||||||
|
"""Flag invoices originating from laundry orders."""
|
||||||
|
_inherit = 'account.move'
|
||||||
|
|
||||||
|
is_laundry_invoice = fields.Boolean(
|
||||||
|
string='Laundry Invoice',
|
||||||
|
compute='_compute_is_laundry_invoice',
|
||||||
|
store=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.depends('invoice_line_ids.sale_line_ids.order_id.is_laundry_order')
|
||||||
|
def _compute_is_laundry_invoice(self):
|
||||||
|
for move in self:
|
||||||
|
move.is_laundry_invoice = any(
|
||||||
|
sol.order_id.is_laundry_order
|
||||||
|
for line in move.invoice_line_ids
|
||||||
|
for sol in line.sale_line_ids
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user