@@ -805,10 +805,10 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
if button.has_icon:
|
||||
btn_exec_action_el.set("icon", button.icon)
|
||||
invisible_condition = "state != '%s'" % node.node_name
|
||||
if model == 'purchase.order':
|
||||
invisible_condition = invisible_condition.replace("询价", "draft")
|
||||
# if model == 'purchase.order':
|
||||
# invisible_condition = invisible_condition.replace("询价", "draft")
|
||||
btn_exec_action_el.set("invisible", invisible_condition)
|
||||
btn_exec_action_el.set("context","{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name), )
|
||||
btn_exec_action_el.set("context", "{'btn_key':'%s','active_model':'%s'}" % (button.btn_key, self._name), )
|
||||
else:
|
||||
is_apostille = False
|
||||
if button.btn_hide:
|
||||
|
||||
@@ -11,11 +11,13 @@
|
||||
'views/system_version_views.xml',
|
||||
'views/ir_cron_act_views.xml',
|
||||
'views/yuthon_timed_tasks_views.xml',
|
||||
'views/yuthon_timed_tasks_views.xml',
|
||||
'views/menu.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'yuthon_base/static/src/views/**/*',
|
||||
'yuthon_base/static/src/js/datetime_picker.js',
|
||||
# 'yuthon_base/static/src/scss/base.css',
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { DateTimePicker } from "@web/core/datetime/datetime_picker";
|
||||
import { isMobileOS } from "@web/core/browser/feature_detection";
|
||||
import { useEffect, useRef, reactive } from "@odoo/owl";
|
||||
|
||||
patch(DateTimePicker.prototype, {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.forMoblieRef = useRef("for_mobile_ref");
|
||||
|
||||
if (isMobileOS()) {
|
||||
const activeInputEl = document?.activeElement;
|
||||
useEffect(
|
||||
(el, value) => {
|
||||
if (!el) {
|
||||
return;
|
||||
}
|
||||
activeInputEl.blur();
|
||||
setTimeout(() => {
|
||||
const popover = document.querySelector("div.o_popover");
|
||||
if (popover) {
|
||||
const left = popover.style.left;
|
||||
if (left.startsWith("-")) {
|
||||
popover.style.left = "0px";
|
||||
}
|
||||
}
|
||||
}, 250);
|
||||
},
|
||||
() => [this.forMoblieRef.el, activeInputEl.value]
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-inherit="web.DateTimePicker" t-inherit-mode="extension">
|
||||
<xpath expr="//div" position="attributes">
|
||||
<attribute name="t-ref">for_mobile_ref</attribute>
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -17,10 +17,10 @@ class InheritPurchaseOrder(models.Model):
|
||||
)
|
||||
name_title = fields.Char(string="默认标题", default='采购申请单', readonly=True)
|
||||
code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('purchase_workflow_approval_code'))
|
||||
state = fields.Selection(selection_add=[('部门经理', '部门经理'), ('工会主席', '工会主席'),
|
||||
state = fields.Selection(selection_add=[('申请人', '申请人'), ('部门经理', '部门经理'), ('工会主席', '工会主席'),
|
||||
('协办', '协办'),
|
||||
('分管领导', '分管领导'),
|
||||
('总经理', '总经理'), ('归档', '归档')], default='draft')
|
||||
('总经理', '总经理'), ('归档', '归档')], default='申请人')
|
||||
work_end = fields.Boolean(string="结束")
|
||||
user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user)
|
||||
company_id = fields.Many2one(related='user_id.employee_ids.company_id', string="公司")
|
||||
|
||||
Reference in New Issue
Block a user