Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Donation Mass

Entity: mass.request

Compute Method: _compute_unit_offering

View 18.0
Inputs Method Outputs
  • product_id
  • product_id.mass_request_type_id
  • product_id.mass_request_type_id.quantity
  • quantity
  • offering
+ for req in self:
+             mass_quantity = 0
+             unit_offering = 0.0
+             if req.product_id:
+                 mass_quantity = (
+                     req.product_id.mass_request_type_id.quantity * req.quantity
+                 )
+             if mass_quantity:
+                 unit_offering = req.offering / mass_quantity
+             req.unit_offering = unit_offering
+             req.mass_quantity = mass_quantity
  • unit_offering
  • mass_quantity

Back to entity