Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Expenses
Entity: hr.expense
Compute Method: _compute_from_product
| Inputs | Method | Outputs |
|---|---|---|
|
for expense in self:
expense.product_has_cost = expense.product_id and not expense.company_currency_id.is_zero(expense.product_id.standard_price)
- tax_ids = expense.product_id.supplier_taxes_id.filtered_domain(self.env['account.tax']._check_company_domain(expense.company_id))
- expense.product_has_tax = bool(tax_ids)
- if not expense.product_has_cost and expense.state in {'draft', 'reported'} and expense.quantity != 1:
- expense.quantity = 1
+ expense.product_has_tax = bool(expense.product_id.supplier_taxes_id.filtered_domain(self.env['account.tax']._check_company_domain(expense.company_id)))
|
|
