Accept Merge Request #694: (feature/制造代码优化 -> develop)

Merge Request: 优化代码,修改库存货架货位为标签

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/694?initial=true
This commit is contained in:
马广威
2023-11-24 21:46:16 +08:00
committed by Coding
13 changed files with 396 additions and 42 deletions

View File

@@ -5,7 +5,7 @@ import logging
import json
from re import split as regex_split
from re import findall as regex_findall
from datetime import datetime, timedelta
from datetime import datetime
import requests
from odoo import SUPERUSER_ID, _, api, fields, models
from odoo.tools import float_compare
@@ -149,8 +149,8 @@ class StockRule(models.Model):
raise ProcurementException(errors)
for company_id, productions_values in productions_values_by_company.items():
# create the MO as SUPERUSER because the current user may not have the rights to do it (mto product
# launched by a sale for example)
# create the MO as SUPERUSER because the current user may not have the rights to do it
# (mto product launched by a sale for example)
'''创建制造订单'''
productions = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create(
productions_values)
@@ -201,18 +201,17 @@ class StockRule(models.Model):
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
if sale_order:
bb = sale_order.deadline_of_delivery
productions = self.env['sf.production.plan'].with_user(SUPERUSER_ID).sudo().with_company(company_id). \
create({
'name': production.name,
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,
'date_planned_start': production.date_planned_start,
'origin': production.origin,
'product_qty': production.product_qty,
'product_id': production.product_id.id,
'state': 'draft',
})
self.env['sf.production.plan'].sudo().with_company(company_id). \
create({
'name': production.name,
'order_deadline': sale_order.deadline_of_delivery,
'production_id': production.id,
'date_planned_start': production.date_planned_start,
'origin': production.origin,
'product_qty': production.product_qty,
'product_id': production.product_id.id,
'state': 'draft',
})
return True

View File

@@ -38,7 +38,7 @@ class CustomKanbanController extends KanbanController {
const button = ev.currentTarget;
const id = button.getAttribute('data-id');
console.log('true_id', id);
// console.log('true_id', id);
// const context = {production_line_show: 'shengchanxian1'}
this.env.services.rpc('/web/dataset/call_kw', {
model: 'mrp.workcenter',