fix-purchase_cycle
This commit is contained in:
parent
1c967bace1
commit
16c1b65137
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -55,11 +55,12 @@ class PurchaseRequest(models.Model):
|
||||||
if not self.employee_id.department_id:
|
if not self.employee_id.department_id:
|
||||||
raise ValidationError(_("Choose A Department For this Employee!"))
|
raise ValidationError(_("Choose A Department For this Employee!"))
|
||||||
line_ids = []
|
line_ids = []
|
||||||
for line in self.line_ids:
|
print("hereeeeeeee",self.line_ids.filtered(lambda line: line.qty_purchased > 0).mapped("product_id.name"))
|
||||||
|
for line in self.line_ids.filtered(lambda line: line.qty_purchased > 0):
|
||||||
line_ids.append((0, 6, {
|
line_ids.append((0, 6, {
|
||||||
'product_id': line.product_id.id,
|
'product_id': line.product_id.id,
|
||||||
'department_id': line.request_id.department_id.id or False,
|
'department_id': line.request_id.department_id.id or False,
|
||||||
'product_qty': line.qty-line.available_qty,
|
'product_qty': line.qty_purchased,
|
||||||
'name': line.product_id.name,
|
'name': line.product_id.name,
|
||||||
'account_analytic_id': line.account_id.id,
|
'account_analytic_id': line.account_id.id,
|
||||||
}))
|
}))
|
||||||
|
|
@ -90,7 +91,7 @@ class PurchaseRequest(models.Model):
|
||||||
for line in self.line_ids.filtered(lambda line: line.qty_purchased > 0):
|
for line in self.line_ids.filtered(lambda line: line.qty_purchased > 0):
|
||||||
line_ids.append((0, 6, {
|
line_ids.append((0, 6, {
|
||||||
'product_id': line.product_id.id,
|
'product_id': line.product_id.id,
|
||||||
'product_qty': line.qty-line.available_qty,
|
'product_qty': line.qty_purchased,
|
||||||
'name':line.description or line.product_id.name,
|
'name':line.description or line.product_id.name,
|
||||||
'department_name': self.employee_id.department_id.id,
|
'department_name': self.employee_id.department_id.id,
|
||||||
'account_analytic_id': line.account_id.id,
|
'account_analytic_id': line.account_id.id,
|
||||||
|
|
@ -128,8 +129,6 @@ class PurchaseRequest(models.Model):
|
||||||
|
|
||||||
|
|
||||||
if any(self.line_ids.filtered(lambda line: line.qty > line.available_qty and line.product_id.type == 'product' )):
|
if any(self.line_ids.filtered(lambda line: line.qty > line.available_qty and line.product_id.type == 'product' )):
|
||||||
product=self.line_ids.filtered(lambda line: line.qty > line.available_qty and line.product_id.type == 'product').mapped("product_id.name")
|
|
||||||
print("product",product)
|
|
||||||
context={}
|
context={}
|
||||||
view = self.env.ref('purchase_custom_stock.purchase_request_picking_wizard_view_form')
|
view = self.env.ref('purchase_custom_stock.purchase_request_picking_wizard_view_form')
|
||||||
wiz = self.env['purchase.request_picking.wizard']
|
wiz = self.env['purchase.request_picking.wizard']
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -481,6 +481,8 @@ class PurchaseOrderCustom(models.Model):
|
||||||
"""
|
"""
|
||||||
Move document to Wait state
|
Move document to Wait state
|
||||||
"""
|
"""
|
||||||
|
if self.requisition_id:
|
||||||
|
self.requisition_id.write({'state': 'in_progress'})
|
||||||
self.write({'state': 'wait', 'is_signed': False})
|
self.write({'state': 'wait', 'is_signed': False})
|
||||||
|
|
||||||
def action_select(self):
|
def action_select(self):
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue