Compare commits
3 Commits
master_sf_
...
hotfix/解决采
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05b5e9cfd9 | ||
|
|
86dfd437cc | ||
|
|
3a92e4cfd8 |
@@ -29,6 +29,10 @@ class PurchaseRequest(models.Model):
|
|||||||
action['context'] = origin_context
|
action['context'] = origin_context
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
|
def button_in_progress(self):
|
||||||
|
return self.write({"state": "in_progress"})
|
||||||
|
|
||||||
class PurchaseRequestLine(models.Model):
|
class PurchaseRequestLine(models.Model):
|
||||||
_inherit = 'purchase.request.line'
|
_inherit = 'purchase.request.line'
|
||||||
_description = '采购申请明细'
|
_description = '采购申请明细'
|
||||||
|
|||||||
@@ -101,6 +101,23 @@ class PurchaseRequestLineMakePurchaseOrder(models.TransientModel):
|
|||||||
# 去掉合并必须同一采购组的限制
|
# 去掉合并必须同一采购组的限制
|
||||||
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):
|
||||||
_inherit = "purchase.request.line.make.purchase.order.item"
|
_inherit = "purchase.request.line.make.purchase.order.item"
|
||||||
|
|||||||
Reference in New Issue
Block a user