Skip to content
Extraits de code Groupes Projets
Valider 83da890e rédigé par Julien - Le Filament's avatar Julien - Le Filament
Parcourir les fichiers

[add] handle del inj counter for auto sale price

parent b24c8567
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!916.0 auto price conf
...@@ -338,12 +338,17 @@ class AccOperation(models.Model): ...@@ -338,12 +338,17 @@ class AccOperation(models.Model):
""" """
create sale price conf on new counter create sale price conf on new counter
""" """
if counter_id.type in ["del"]: if counter_id.type in ["del", "del_inj"]:
inj_periods = self.env["acc.counter.period"].search( inj_periods = self.env["acc.counter.period"].search(
[("acc_operation_id", "=", self.id), ("prm_type", "=", "injection")] [("acc_operation_id", "=", self.id), ("prm_type", "=", "injection")]
) )
for inj_period in inj_periods: for inj_period in inj_periods:
if counter_id.type == "del_inj":
price = self.sale_price_by_default
else:
price = inj_period.sale_price
self.env["acc.price.conf"].create( self.env["acc.price.conf"].create(
{ {
"start_date": inj_period.start_date, "start_date": inj_period.start_date,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter