mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] sale_timesheet_work_entry_rate: compute billing amount, display
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountAnalyticLine(models.Model):
|
||||
_inherit = 'account.analytic.line'
|
||||
|
||||
work_billing_rate = fields.Float(related='work_type_id.timesheet_billing_rate', string='Billing Multiplier')
|
||||
work_billing_amount = fields.Float(string='Billing Amount',
|
||||
compute='_compute_work_billing_amount', store=True)
|
||||
|
||||
@api.depends('unit_amount', 'work_billing_rate')
|
||||
def _compute_work_billing_amount(self):
|
||||
for ts in self:
|
||||
ts.work_billing_amount = ts.unit_amount * \
|
||||
(ts.work_billing_rate if ts.work_type_id else 1.0)
|
||||
|
||||
Reference in New Issue
Block a user