错误问题处理

This commit is contained in:
mgw
2023-11-23 22:14:12 +08:00
parent 2510f5fbf3
commit fee3572f38
3 changed files with 21 additions and 22 deletions

View File

@@ -3,7 +3,6 @@ import logging
import requests import requests
from odoo import fields, models from odoo import fields, models
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)

View File

@@ -5,7 +5,7 @@ import logging
import json import json
from re import split as regex_split from re import split as regex_split
from re import findall as regex_findall from re import findall as regex_findall
from datetime import datetime, timedelta from datetime import datetime
import requests import requests
from odoo import SUPERUSER_ID, _, api, fields, models from odoo import SUPERUSER_ID, _, api, fields, models
from odoo.tools import float_compare from odoo.tools import float_compare
@@ -148,7 +148,8 @@ class StockRule(models.Model):
raise ProcurementException(errors) raise ProcurementException(errors)
for company_id, productions_values in productions_values_by_company.items(): 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 = self.env['mrp.production'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create(
productions_values) productions_values)
@@ -198,8 +199,7 @@ class StockRule(models.Model):
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)]) sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
if sale_order: if sale_order:
bb = sale_order.deadline_of_delivery self.env['sf.production.plan'].sudo().with_company(company_id). \
productions = self.env['sf.production.plan'].sudo().with_company(company_id). \
create({ create({
'name': production.name, 'name': production.name,
'order_deadline': sale_order.deadline_of_delivery, 'order_deadline': sale_order.deadline_of_delivery,

View File

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