Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化
This commit is contained in:
@@ -157,11 +157,11 @@ td.o_required_modifier {
|
|||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_kanban_primary_left {
|
// .o_kanban_primary_left {
|
||||||
display: flex;
|
// display: flex;
|
||||||
flex-direction: row-reverse;
|
// flex-direction: row-reverse;
|
||||||
justify-content: flex-start;
|
// justify-content: flex-start;
|
||||||
}
|
// }
|
||||||
|
|
||||||
.o_list_view .o_list_table thead {
|
.o_list_view .o_list_table thead {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class MrpProduction(models.Model):
|
|||||||
采购请求
|
采购请求
|
||||||
"""
|
"""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', self.name)])
|
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', self.name),('is_subcontract', '!=', True)])
|
||||||
action = {
|
action = {
|
||||||
'res_model': 'purchase.request',
|
'res_model': 'purchase.request',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
|
|||||||
@@ -148,12 +148,17 @@ td.o_required_modifier {
|
|||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.o_kanban_primary_left {
|
// .o_kanban_primary_left {
|
||||||
display: flex;
|
// display: flex;
|
||||||
flex-direction: row-reverse;
|
// flex-direction: row-reverse;
|
||||||
justify-content: flex-start;
|
// justify-content: flex-start;
|
||||||
|
// }
|
||||||
|
.o_list_button {
|
||||||
|
min-width: 32px;
|
||||||
|
}
|
||||||
|
.o_list_record_remove {
|
||||||
|
padding-left: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.diameter:before {
|
.diameter:before {
|
||||||
content:"Ф";
|
content:"Ф";
|
||||||
display:inline;
|
display:inline;
|
||||||
|
|||||||
@@ -922,6 +922,7 @@ class MrpProduction(models.Model):
|
|||||||
"requested_by": self.env.context.get("uid", self.env.uid),
|
"requested_by": self.env.context.get("uid", self.env.uid),
|
||||||
"assigned_to": False,
|
"assigned_to": False,
|
||||||
"bom_id": self[0].bom_id.id,
|
"bom_id": self[0].bom_id.id,
|
||||||
|
"is_subcontract":True,
|
||||||
})
|
})
|
||||||
for product_id, request_line_list in grouped_purchase_request_line_sorted_list.items():
|
for product_id, request_line_list in grouped_purchase_request_line_sorted_list.items():
|
||||||
cur_request_line = request_line_list[0]
|
cur_request_line = request_line_list[0]
|
||||||
|
|||||||
@@ -69,7 +69,18 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效',
|
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效',
|
||||||
tracking=True)
|
tracking=True)
|
||||||
back_button_display = fields.Boolean(default=False, compute='_compute_back_button_display', store=True)
|
back_button_display = fields.Boolean(default=False, compute='_compute_back_button_display', store=True)
|
||||||
|
pr_mp_count = fields.Integer('采购申请单数量', compute='_compute_pr_mp_count', store=True)
|
||||||
|
@api.depends('state')
|
||||||
|
def _compute_pr_mp_count(self):
|
||||||
|
for item in self:
|
||||||
|
if not item.is_subcontract:
|
||||||
|
item.pr_mp_count = 0
|
||||||
|
continue
|
||||||
|
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', item.name),('is_subcontract','=','True')])
|
||||||
|
if pr_ids:
|
||||||
|
item.pr_mp_count = len(pr_ids)
|
||||||
|
else:
|
||||||
|
item.pr_mp_count = 0
|
||||||
@api.depends('state')
|
@api.depends('state')
|
||||||
def _compute_back_button_display(self):
|
def _compute_back_button_display(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -445,6 +456,28 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
else:
|
else:
|
||||||
order.surface_technics_purchase_count = 0
|
order.surface_technics_purchase_count = 0
|
||||||
|
|
||||||
|
def action_view_pr_mrp_workorder(self):
|
||||||
|
"""
|
||||||
|
采购请求
|
||||||
|
"""
|
||||||
|
self.ensure_one()
|
||||||
|
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'like', self.name),('is_subcontract', '=', True)])
|
||||||
|
action = {
|
||||||
|
'res_model': 'purchase.request',
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
}
|
||||||
|
if len(pr_ids) == 1:
|
||||||
|
action.update({
|
||||||
|
'view_mode': 'form',
|
||||||
|
'res_id': pr_ids[0].id,
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
action.update({
|
||||||
|
'name': _("从 %s生成采购请求单", self.name),
|
||||||
|
'domain': [('id', 'in', pr_ids)],
|
||||||
|
'view_mode': 'tree,form',
|
||||||
|
})
|
||||||
|
return action
|
||||||
def action_view_surface_technics_purchase(self):
|
def action_view_surface_technics_purchase(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
# if self.routing_type == '表面工艺':
|
# if self.routing_type == '表面工艺':
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ from odoo.exceptions import UserError, ValidationError
|
|||||||
from odoo.tools import float_compare, float_round, float_is_zero, format_datetime
|
from odoo.tools import float_compare, float_round, float_is_zero, format_datetime
|
||||||
|
|
||||||
|
|
||||||
|
class PurchaseRequestLine(models.Model):
|
||||||
|
_inherit = 'purchase.request'
|
||||||
|
is_subcontract = fields.Boolean(string='是否外协',default=False)
|
||||||
class PurchaseRequestLine(models.Model):
|
class PurchaseRequestLine(models.Model):
|
||||||
_inherit = 'purchase.request.line'
|
_inherit = 'purchase.request.line'
|
||||||
is_subcontract = fields.Boolean(string='是否外协')
|
is_subcontract = fields.Boolean(string='是否外协')
|
||||||
|
|||||||
@@ -144,6 +144,17 @@
|
|||||||
statusbar_visible="pending,waiting,ready,progress,to be detected,done,rework"/>
|
statusbar_visible="pending,waiting,ready,progress,to be detected,done,rework"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@name='button_box']" position="inside">
|
<xpath expr="//div[@name='button_box']" position="inside">
|
||||||
|
<button type="object" name="action_view_pr_mrp_workorder" class="oe_stat_button"
|
||||||
|
icon="fa-credit-card"
|
||||||
|
groups="base.group_user,sf_base.group_sf_order_user"
|
||||||
|
attrs="{'invisible': [('pr_mp_count', '=', 0)]}">
|
||||||
|
<div class="o_field_widget o_stat_info">
|
||||||
|
<span class="o_stat_value">
|
||||||
|
<field name="pr_mp_count"/>
|
||||||
|
</span>
|
||||||
|
<span class="o_stat_text">采购</span>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
<button type="object" name="action_view_surface_technics_purchase" class="oe_stat_button"
|
<button type="object" name="action_view_surface_technics_purchase" class="oe_stat_button"
|
||||||
icon="fa-credit-card"
|
icon="fa-credit-card"
|
||||||
groups="base.group_user,sf_base.group_sf_order_user"
|
groups="base.group_user,sf_base.group_sf_order_user"
|
||||||
|
|||||||
Reference in New Issue
Block a user