Advertisement
rht_odoo

[4166236] price 100 ltr/kg

Oct 30th, 2024 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. PRODUCT
  2.  
  3. # Done by ROBO and RHT on the 30/10/2024
  4. # https://pastebin.com/skzcKGmM
  5. # Task : https://www.odoo.com/odoo/project.task/4166236
  6. # Need : have the price of the product per 100 L/Kg (on product, sale order line and rapport)
  7. for product in self:
  8.     if product.list_price != 0 and product.base_unit_count != 0:
  9.         product['x_studio_spl_100l'] = product.list_price * (100/product.base_unit_count)
  10.  
  11. SALE ORDER LINE
  12.  
  13. # Done by ROBO and RHT on the 30/10/2024
  14. # https://pastebin.com/skzcKGmM
  15. # Task : https://www.odoo.com/odoo/project.task/4166236
  16. # Need : have the price of the product per 100 L/Kg (on product, sale order line and rapport)
  17. for sol in self:
  18.     if sol.order_id.state != 'sale' and sol.x_studio_product_base_unit_count !=0:
  19.         sp100 = sol.price_unit * (100/sol.x_studio_product_base_unit_count)
  20.         sol['x_studio_sp_100l'] = sp100 - (sp100 * (sol.discount/100))
  21.  
  22. SALE REPORT
  23.               <!-- [4166236]  have the price of the product per 100 L/Kg (on product, sale order line and rapport) -->
  24.               <th name="th_sp_100l" class="text-end">Per 100 LTR/KG</th>
  25.  
  26.                   <!-- [4166236]  have the price of the product per 100 L/Kg (on product, sale order line and rapport) -->
  27.                   <td name="td_sp_100" class="text-end">
  28.                        <span t-esc="int(line.x_studio_sp_100l)">3</span>
  29.                     </td>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement