addons14/sale_timesheet_rounded/models/account_analytic_line.py
def read_group(
        self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True
    ):
        """Replace the value of unit_amount by unit_amount_rounded.

        When context key `timesheet_rounding` is True
        we change the value of unit_amount with the rounded one.
        This affects `sale_order_line._compute_delivered_quantity`
        which in turns compute the delivered qty on SO line.
        """
        ctx_ts_rounded = self.env.context.get("timesheet_rounding")
        fields_local = list(fields) if fields else []
        if ctx_ts_rounded and "unit_amount_rounded" not in fields_local:
            # To add the unit_amount_rounded value on read_group
            fields_local.append("unit_amount_rounded")
        res = super().read_group(
            domain,
            fields_local,
            groupby,
            offset=offset,
            limit=limit,
            orderby=orderby,
            lazy=lazy,
        )
        if ctx_ts_rounded:
            # To set the unit_amount_rounded value instead of unit_amount
            for rec in res:
                rec["unit_amount"] = rec["unit_amount_rounded"]
        return res
Replace the value of unit_amount by unit_amount_rounded.

        When context key `timesheet_rounding` is True
        we change the value of unit_amount with the rounded one.
        This affects `sale_order_line._compute_delivered_quantity`
        which in turns compute the delivered qty on SO line.
        
Replace the value of unit_amount by unit_amount_rounded.
When context key `timesheet_rounding` is True
we change the value of unit_amount with the rounded one.
This affects `sale_order_line._compute_delivered_quantity`
which in turns compute the delivered qty on SO line.
Replace the value of unit_amount by unit_amount_rounded . When context key ` timesheet_rounding ` is True we change the value of unit_amount with the rounded one . This affects ` sale_order_line . _compute_delivered_quantity ` which in turns compute the delivered qty on SO line .
def read_group(
        self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True
    ):
        ctx_ts_rounded = self.env.context.get("timesheet_rounding")
        fields_local = list(fields) if fields else []
        if ctx_ts_rounded and "unit_amount_rounded" not in fields_local:
            fields_local.append("unit_amount_rounded")
        res = super().read_group(
            domain,
            fields_local,
            groupby,
            offset=offset,
            limit=limit,
            orderby=orderby,
            lazy=lazy,
        )
        if ctx_ts_rounded:
            for rec in res:
                rec["unit_amount"] = rec["unit_amount_rounded"]
        return res
def read_group ( self , domain , fields , groupby , offset = 0 , limit = None , orderby = False , lazy = True ) : ctx_ts_rounded = self . env . context . get ( "timesheet_rounding" ) fields_local = list ( fields ) if fields else [ ] if ctx_ts_rounded and "unit_amount_rounded" not in fields_local : fields_local . append ( "unit_amount_rounded" ) res = super ( ) . read_group ( domain , fields_local , groupby , offset = offset , limit = limit , orderby = orderby , lazy = lazy , ) if ctx_ts_rounded : for rec in res : rec [ "unit_amount" ] = rec [ "unit_amount_rounded" ] return res
Replace the value of unit_amount by unit_amount_rounded.
Replace the value of unit_amount by unit_amount_rounded .
"""Replace the value of unit_amount by unit_amount_rounded.

        When context key `timesheet_rounding` is True
        we change the value of unit_amount with the rounded one.
        This affects `sale_order_line._compute_delivered_quantity`
        which in turns compute the delivered qty on SO line.
        """ # To add the unit_amount_rounded value on read_group # To set the unit_amount_rounded value instead of unit_amount
self
domain
fields
groupby
offset
limit
orderby
lazy