File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
product_catalog_tree/models Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,18 @@ def _inverse_catalog_values(self, product_catalog_qty):
5656
5757 order = self .env [res_model ].browse (order_id )
5858 for rec in self :
59+ # Actualizar la información de la línea de orden
5960 order .with_company (order .company_id )._update_order_line_info (rec .id , product_catalog_qty )
6061
62+ # Si la cantidad es mayor a 0, recalcular precios y descuentos
63+ if product_catalog_qty > 0 :
64+ order_lines = order .order_line .filtered (lambda line : line .product_id .id == rec .id )
65+ if order_lines :
66+ # Tomamos la última línea en caso de que haya varias
67+ order_line = order_lines [- 1 ]
68+ # Ejecutar el método que recalcula linea
69+ order_line ._compute_price_unit_and_date_planned_and_name ()
70+
6171 def increase_quantity (self ):
6272 for rec in self :
6373 rec ._inverse_catalog_values (rec .product_catalog_qty + 1 )
You can’t perform that action at this time.
0 commit comments