1、采购审批流程中的英文提示信息改为中文提示;当审批完成后隐藏取消审批按键;2、刀具注册接口添加调用接口提示;
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
# Copyright 2017-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
# Copyright 2017-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from ast import literal_eval
|
|
||||||
|
|
||||||
from lxml import etree
|
|
||||||
|
|
||||||
from odoo import _, api, fields, models
|
from odoo import _, api, fields, models
|
||||||
from odoo.exceptions import ValidationError
|
|
||||||
from odoo.tools.misc import frozendict
|
|
||||||
|
|
||||||
|
|
||||||
class TierValidation(models.AbstractModel):
|
class TierValidation(models.AbstractModel):
|
||||||
|
|||||||
@@ -1,122 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="tier_validation_buttons">
|
<template id="tier_validation_buttons_sf"
|
||||||
<div>
|
inherit_id="base_tier_validation.tier_validation_buttons">
|
||||||
<button
|
<xpath expr="//button[@name='request_validation']" position="attributes">
|
||||||
name="request_validation"
|
<attribute name="string">发起审批</attribute>
|
||||||
string="发起审批"
|
</xpath>
|
||||||
t-attf-attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('#{state_field}', '#{state_operator}', #{state_value})]}"
|
<xpath expr="//button[@name='restart_validation']" position="attributes">
|
||||||
type="object"
|
<attribute name="string">取消审批</attribute>
|
||||||
/>
|
<attribute name="t-attf-attrs">{'invisible': ['|','|',('review_ids', '=', []),('#{state_field}',
|
||||||
<button
|
'#{state_operator}', #{state_value}), ('validated', '=', True)]}
|
||||||
name="restart_validation"
|
</attribute>
|
||||||
string="取消审批"
|
</xpath>
|
||||||
t-attf-attrs="{'invisible': ['|',('review_ids', '=', []),('#{state_field}', '#{state_operator}', #{state_value})]}"
|
|
||||||
type="object"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template id="tier_validation_label">
|
<template id="tier_validation_label_sf"
|
||||||
<div>
|
inherit_id="base_tier_validation_forward.tier_validation_label_forward">
|
||||||
<field name="need_validation" invisible="1" />
|
<xpath expr="//p/i[@class='fa fa-info-circle']" position="replace">
|
||||||
<field name="validated" invisible="1" />
|
<i class="fa fa-info-circle"/>
|
||||||
<field name="rejected" invisible="1" />
|
这个单据需要验证.
|
||||||
<div
|
</xpath>
|
||||||
class="alert alert-warning"
|
<xpath expr="//div[@class='alert alert-success'][@role='alert']/p" position="replace">
|
||||||
role="alert"
|
|
||||||
t-attf-attrs="{'invisible': ['|', '|', '|',
|
|
||||||
('validated', '=', True), ('#{state_field}', '#{state_operator}', #{state_value}),
|
|
||||||
('rejected', '=', True), ('review_ids', '=', [])]}"
|
|
||||||
style="margin-bottom:0px;"
|
|
||||||
>
|
|
||||||
<p>
|
<p>
|
||||||
<i class="fa fa-info-circle" />
|
<i class="fa fa-thumbs-up"/>
|
||||||
这个单据需要验证.
|
审批已通过.
|
||||||
<field name="can_review" invisible="1" />
|
|
||||||
<button
|
|
||||||
name="validate_tier"
|
|
||||||
string="验证"
|
|
||||||
attrs="{'invisible': [('can_review', '=', False)]}"
|
|
||||||
type="object"
|
|
||||||
class="oe_inline oe_button btn-success"
|
|
||||||
icon="fa-thumbs-up"
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
name="reject_tier"
|
|
||||||
string="拒绝"
|
|
||||||
attrs="{'invisible': [('can_review', '=', False)]}"
|
|
||||||
type="object"
|
|
||||||
class="btn-icon btn-danger"
|
|
||||||
icon="fa-thumbs-down"
|
|
||||||
/>
|
|
||||||
<br /><field name="next_review" readonly="1" />
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</xpath>
|
||||||
<div
|
<xpath expr="//button[@name='validate_tier']" position="attributes">
|
||||||
class="alert alert-success"
|
<attribute name="string">验证</attribute>
|
||||||
role="alert"
|
</xpath>
|
||||||
t-attf-attrs="{'invisible': ['|', '|', ('validated', '!=', True), ('#{state_field}', '#{state_operator}', #{state_value}), ('review_ids', '=', [])]}"
|
<xpath expr="//button[@name='reject_tier']" position="attributes">
|
||||||
style="margin-bottom:0px;"
|
<attribute name="string">拒绝</attribute>
|
||||||
>
|
|
||||||
<p>
|
|
||||||
<i class="fa fa-thumbs-up" />
|
|
||||||
Operation has been
|
|
||||||
<b>validated</b>
|
|
||||||
!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="alert alert-danger"
|
|
||||||
role="alert"
|
|
||||||
t-attf-attrs="{'invisible': ['|', '|', ('rejected', '!=', True), ('#{state_field}', '#{state_operator}', #{state_value}), ('review_ids', '=', [])]}"
|
|
||||||
style="margin-bottom:0px;"
|
|
||||||
>
|
|
||||||
<p>
|
|
||||||
<i class="fa fa-thumbs-down" />
|
|
||||||
Operation has been
|
|
||||||
<b>rejected</b>
|
|
||||||
.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template id="tier_validation_reviews">
|
|
||||||
<field
|
|
||||||
name="review_ids"
|
|
||||||
widget="tier_validation"
|
|
||||||
attrs="{'invisible':[('review_ids', '=', [])]}"
|
|
||||||
style="width:100%%; margin-top: 10px;"
|
|
||||||
>
|
|
||||||
<tree>
|
|
||||||
<field name="id" />
|
|
||||||
<field name="name" />
|
|
||||||
<field name="sequence" />
|
|
||||||
<field name="requested_by" />
|
|
||||||
<field name="status" />
|
|
||||||
<field name="todo_by" />
|
|
||||||
<field name="done_by" />
|
|
||||||
<field name="reviewed_date" />
|
|
||||||
<field name="reviewed_formated_date" />
|
|
||||||
<field name="comment" />
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
<template
|
|
||||||
id="tier_validation_label_forward"
|
|
||||||
inherit_id="sf_oca.tier_validation_label"
|
|
||||||
>
|
|
||||||
<xpath expr="//button[@name='reject_tier']" position="after">
|
|
||||||
<field name="can_forward" invisible="1" />
|
|
||||||
<button
|
|
||||||
name="forward_tier"
|
|
||||||
string="Forward"
|
|
||||||
attrs="{'invisible': [('can_forward', '=', False)]}"
|
|
||||||
type="object"
|
|
||||||
class="oe_inline oe_button btn-warning"
|
|
||||||
icon="fa-arrow-circle-right"
|
|
||||||
/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class StockLot(models.Model):
|
|||||||
_description = '刀具物料序列号注册'
|
_description = '刀具物料序列号注册'
|
||||||
|
|
||||||
def enroll_tool_material_stock(self):
|
def enroll_tool_material_stock(self):
|
||||||
|
logging.info('调用刀具物料序列号注册接口: enroll_tool_material_stock()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -69,6 +70,7 @@ class StockLot(models.Model):
|
|||||||
self._get_sync_stock_lot(objs_all, str_url, token, headers)
|
self._get_sync_stock_lot(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def sync_enroll_tool_material_stock_all(self):
|
def sync_enroll_tool_material_stock_all(self):
|
||||||
|
logging.info('调用刀具物料序列号注册接口: sync_enroll_tool_material_stock_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -104,6 +106,7 @@ class ToolMaterial(models.Model):
|
|||||||
crea_url = '/api/tool_material/create'
|
crea_url = '/api/tool_material/create'
|
||||||
|
|
||||||
def enroll_tool_material(self):
|
def enroll_tool_material(self):
|
||||||
|
logging.info('调用刀具物料注册接口: enroll_tool_material()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -113,6 +116,7 @@ class ToolMaterial(models.Model):
|
|||||||
self._get_sync_tool_material_search(objs_all, str_url, token, headers)
|
self._get_sync_tool_material_search(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def sync_enroll_tool_material_all(self):
|
def sync_enroll_tool_material_all(self):
|
||||||
|
logging.info('调用刀具物料注册接口: sync_enroll_tool_material_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -163,6 +167,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
|
|
||||||
# 注册同步功能刀具列表
|
# 注册同步功能刀具列表
|
||||||
def enroll_functional_tool_entity(self):
|
def enroll_functional_tool_entity(self):
|
||||||
|
logging.info('调用功能刀具列表注册接口: enroll_functional_tool_entity()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -172,6 +177,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
self._get_sync_functional_cutting_tool_entity(objs_all, str_url, token, headers)
|
self._get_sync_functional_cutting_tool_entity(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def esync_enroll_functional_tool_entity_all(self):
|
def esync_enroll_functional_tool_entity_all(self):
|
||||||
|
logging.info('调用功能刀具列表注册接口: esync_enroll_functional_tool_entity_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -256,6 +262,7 @@ class FunctionalToolWarning(models.Model):
|
|||||||
|
|
||||||
# 注册同步功能刀具预警
|
# 注册同步功能刀具预警
|
||||||
def enroll_functional_tool_warning(self):
|
def enroll_functional_tool_warning(self):
|
||||||
|
logging.info('调用功能刀具预警注册接口: enroll_functional_tool_warning()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -265,6 +272,7 @@ class FunctionalToolWarning(models.Model):
|
|||||||
self.get_sync_functional_tool_warning(objs_all, str_url, token, headers)
|
self.get_sync_functional_tool_warning(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def sync_enroll_functional_tool_warning_all(self):
|
def sync_enroll_functional_tool_warning_all(self):
|
||||||
|
logging.info('调用功能刀具预警注册接口: sync_enroll_functional_tool_warning_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -329,6 +337,7 @@ class StockMoveLine(models.Model):
|
|||||||
|
|
||||||
# 注册同步功能刀具出入库记录
|
# 注册同步功能刀具出入库记录
|
||||||
def enroll_functional_tool_move(self):
|
def enroll_functional_tool_move(self):
|
||||||
|
logging.info('调用功能刀具出入库记录注册接口: enroll_functional_tool_move()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -338,6 +347,7 @@ class StockMoveLine(models.Model):
|
|||||||
self.get_sync_stock_move_line(objs_all, str_url, token, headers)
|
self.get_sync_stock_move_line(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def sync_enroll_functional_tool_move_all(self):
|
def sync_enroll_functional_tool_move_all(self):
|
||||||
|
logging.info('调用功能刀具出入库记录注册接口: sync_enroll_functional_tool_move_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -393,6 +403,7 @@ class RealTimeDistributionFunctionalTools(models.Model):
|
|||||||
|
|
||||||
# 注册同步功能刀具预警
|
# 注册同步功能刀具预警
|
||||||
def enroll_functional_tool_real_time_distribution(self):
|
def enroll_functional_tool_real_time_distribution(self):
|
||||||
|
logging.info('调用功能刀具安全库存注册接口: enroll_functional_tool_real_time_distribution()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
@@ -402,6 +413,7 @@ class RealTimeDistributionFunctionalTools(models.Model):
|
|||||||
self.get_sync_real_time_distribution_functional_tools(objs_all, str_url, token, headers)
|
self.get_sync_real_time_distribution_functional_tools(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def sync_enroll_functional_tool_real_time_distribution_all(self):
|
def sync_enroll_functional_tool_real_time_distribution_all(self):
|
||||||
|
logging.info('调用功能刀具安全库存注册接口: sync_enroll_functional_tool_real_time_distribution_all()')
|
||||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||||
token = sf_sync_config['token']
|
token = sf_sync_config['token']
|
||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
|
|||||||
Reference in New Issue
Block a user