解决创建采购申请报错
This commit is contained in:
@@ -100,6 +100,22 @@ class PurchaseRequestLineMakePurchaseOrder(models.TransientModel):
|
|||||||
def check_group(self, request_lines):
|
def check_group(self, request_lines):
|
||||||
# 去掉合并必须同一采购组的限制
|
# 去掉合并必须同一采购组的限制
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def _post_process_po_line(self, item, po_line, new_pr_line):
|
||||||
|
self.ensure_one()
|
||||||
|
line = item.line_id
|
||||||
|
# TODO: Check propagate_uom compatibility:
|
||||||
|
new_qty = self.env["purchase.request.line"]._calc_new_qty(
|
||||||
|
line, po_line=po_line, new_pr_line=new_pr_line
|
||||||
|
)
|
||||||
|
po_line.product_qty = new_qty
|
||||||
|
# The quantity update triggers a compute method that alters the
|
||||||
|
# unit price (which is what we want, to honor graduate pricing)
|
||||||
|
# but also the scheduled date which is what we don't want.
|
||||||
|
date_required = line.date_required
|
||||||
|
po_line.date_planned = datetime(
|
||||||
|
date_required.year, date_required.month, date_required.day
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class PurchaseRequestLineMakePurchaseOrderItem(models.TransientModel):
|
class PurchaseRequestLineMakePurchaseOrderItem(models.TransientModel):
|
||||||
|
|||||||
Reference in New Issue
Block a user