mirror of
https://github.com/bringout/oca-mrp.git
synced 2026-04-24 00:12:05 +02:00
23 lines
958 B
Python
23 lines
958 B
Python
# Copyright 2019 Camptocamp SA
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
|
|
|
from odoo import api, models
|
|
|
|
|
|
class SaleOrderLine(models.Model):
|
|
_inherit = "sale.order.line"
|
|
|
|
def _get_delivered_quantity_by_analytic(self, additional_domain):
|
|
# If we land here is only because we are dealing w/ SO lines
|
|
# having `qty_delivered_method` equal to `analytic` or `timesheet`.
|
|
# The 1st case matches expenses lines the latter TS lines.
|
|
# Expenses are already discarded in our a.a.l. overrides
|
|
# so it's fine to set the ctx key here anyway.
|
|
return super(
|
|
SaleOrderLine, self.with_context(timesheet_rounding=True)
|
|
)._get_delivered_quantity_by_analytic(additional_domain)
|
|
|
|
@api.depends("analytic_line_ids.unit_amount_rounded")
|
|
def _compute_qty_delivered(self):
|
|
"""Adds the dependency on unit_amount_rounded."""
|
|
return super()._compute_qty_delivered()
|