Do not set the unit price of the purchased lines from the request to zero

Since 65be15fb7d8a its possible to set empty unit price

Closes #13886
This commit is contained in:
Sergi Almacellas Abellana committed 2025-02-24 10:29:45 +01:00
1 parent 0fd308172e
commit 4288e9c6b0
2 files changed
-5

No files matched your search

@@ -1,7 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import datetime
from decimal import Decimal
from functools import partial
from itertools import groupby
@@ -10,7 +9,6 @@ from trytond.model import Index, ModelSQL, ModelView, fields
from trytond.model.exceptions import AccessError
from trytond.modules.company.model import (
employee_field, reset_employee, set_employee)
from trytond.modules.product import round_price
from trytond.pool import Pool
from trytond.pyson import Bool, Eval, If
from trytond.tools import firstline, sortable_values
@@ -494,8 +492,6 @@ class CreatePurchase(Wizard):
for f, v in key:
setattr(line, f, v)
line.on_change_quantity()
if line.unit_price is None:
line.unit_price = round_price(Decimal(0))
return line
@classmethod
@@ -266,7 +266,6 @@ Create the purchase without product::
1.0
>>> pr.purchase_line.unit
>>> pr.purchase_line.unit_price
Decimal('0.0000')
It's not possible to delete a purchase linked to a purchase_request::