Accept Merge Request #1968: (feature/mrp_bug_fixed -> develop)
Merge Request: 询价单行项目价格判断 Created By: @胡尧 Accepted By: @胡尧 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1968?initial=true
This commit is contained in:
@@ -59,18 +59,16 @@ class PurchaseOrder(models.Model):
|
|||||||
production_id = self.env['mrp.production'].search([('origin', 'in', origins)])
|
production_id = self.env['mrp.production'].search([('origin', 'in', origins)])
|
||||||
purchase.production_count = len(production_id)
|
purchase.production_count = len(production_id)
|
||||||
|
|
||||||
# def button_confirm(self):
|
def write(self, vals):
|
||||||
# super().button_confirm()
|
res = super(PurchaseOrder, self).write(vals)
|
||||||
# workorders = self.env['mrp.workorder'].search([('purchase_id', '=', self.id), ('state', '!=', 'cancel')])
|
for record in self:
|
||||||
# for workorder in workorders:
|
for line in record.order_line:
|
||||||
# if workorder.routing_type == '表面工艺' and workorder.is_subcontract is True:
|
if line.product_qty <= 0:
|
||||||
# move_out = workorder.move_subcontract_workorder_ids[1]
|
raise UserError('请对【产品】中的【数量】进行输入')
|
||||||
# for mo in move_out:
|
if line.price_unit <= 0:
|
||||||
# if mo.state != 'done':
|
raise UserError('请对【产品】中的【单价】进行输入')
|
||||||
# mo.write({'state': 'assigned', 'production_id': False})
|
return res
|
||||||
# if not mo.move_line_ids:
|
|
||||||
# self.env['stock.move.line'].create(mo.get_move_line(workorder.production_id, workorder))
|
|
||||||
# return True
|
|
||||||
|
|
||||||
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')
|
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', store=True, compute='_compute_origin_sale_id')
|
||||||
origin_sale_ids = fields.Many2many('sale.order', string='销售订单号(多个)', store=True,
|
origin_sale_ids = fields.Many2many('sale.order', string='销售订单号(多个)', store=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user