Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/销售权限
# Conflicts: # sf_manufacturing/models/product_template.py
This commit is contained in:
@@ -10,11 +10,12 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['mrp_workorder', 'sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'stock'],
|
||||
'depends': ['sf_base', 'sf_maintenance', 'web_widget_model_viewer', 'stock'],
|
||||
'data': [
|
||||
'data/stock_data.xml',
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/mrp_views_menus.xml',
|
||||
'views/mrp_production_addional_change.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/production_line_view.xml',
|
||||
@@ -22,6 +23,7 @@
|
||||
'views/mrp_workorder_view.xml',
|
||||
'views/model_type_view.xml',
|
||||
'views/sf_maintenance_equipment.xml',
|
||||
|
||||
],
|
||||
'assets': {
|
||||
|
||||
|
||||
@@ -8,8 +8,3 @@ from . import mrp_routing_workcenter
|
||||
from . import stock
|
||||
from . import res_user
|
||||
from . import production_line_base
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
from odoo import fields, models,api
|
||||
|
||||
|
||||
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class ModelType(models.Model):
|
||||
@@ -42,8 +39,6 @@ class ProductModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
@@ -77,7 +72,6 @@ class EmbryoModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
@@ -111,7 +105,6 @@ class SurfaceTechnicsModelTypeRoutingSort(models.Model):
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
|
||||
@@ -67,4 +67,5 @@ class MaintenanceRequest(models.Model):
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_inherit = 'sf.maintenance.logs'
|
||||
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='maintenance_equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='maintenance_equipment_id.production_line_id', store=True)
|
||||
|
||||
@@ -12,7 +12,8 @@ class ResWorkcenter(models.Model):
|
||||
equipment_id = fields.Many2one(
|
||||
'maintenance.equipment', string="设备",
|
||||
)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='equipment_id.production_line_id', store=True)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线',
|
||||
related='equipment_id.production_line_id', store=True)
|
||||
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
users_ids = fields.Many2many("res.users", 'users_workcenter')
|
||||
|
||||
@@ -10,7 +10,6 @@ from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
@@ -289,7 +288,7 @@ class ResProductMo(models.Model):
|
||||
self.suitable_machining_method_ids = [(6, 0, [])] if not \
|
||||
self.cutting_tool_model_id.suitable_machining_method_ids \
|
||||
else [(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||
self.blade_tip_characteristics_id = [(6, 0,[])] if not \
|
||||
self.blade_tip_characteristics_id = [(6, 0, [])] if not \
|
||||
self.cutting_tool_model_id.blade_tip_characteristics_id \
|
||||
else [(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_id.ids)]
|
||||
|
||||
@@ -873,3 +872,11 @@ class SfMaintenanceEquipmentTool(models.Model):
|
||||
alarm_value = fields.Char('报警值')
|
||||
used_value = fields.Char('已使用值')
|
||||
code = fields.Char('机床刀位号')
|
||||
|
||||
name = fields.Char('', compute='_compute_name')
|
||||
|
||||
@api.depends('code')
|
||||
def _compute_name(self):
|
||||
for record in self:
|
||||
if record.code:
|
||||
record.name = record.code
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from odoo import models,fields
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ProductionLine(models.Model):
|
||||
@@ -26,8 +26,3 @@ class ProductionLine(models.Model):
|
||||
name = fields.Char('生产线', size=20, required=True)
|
||||
code = fields.Char('编码', default=_get_code, readonly=True)
|
||||
remark = fields.Char('备注')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -97,12 +97,15 @@ class QualityPoint(models.Model):
|
||||
component_ids = fields.One2many('product.product', compute='_compute_component_ids')
|
||||
product_ids = fields.Many2many(
|
||||
default=_default_product_ids,
|
||||
domain="operation_id and [('id', 'in', bom_product_ids)] or [('type', 'in', ('product', 'consu')), '|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
domain="operation_id and [('id', 'in', bom_product_ids)] or"
|
||||
" [('type', 'in', ('product', 'consu')),"
|
||||
" '|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
bom_product_ids = fields.One2many('product.product', compute="_compute_bom_product_ids")
|
||||
test_type_id = fields.Many2one(
|
||||
'quality.point.test_type',
|
||||
domain="[('allow_registration', '=', operation_id and is_workorder_step)]")
|
||||
test_report_type = fields.Selection([('pdf', 'PDF'), ('zpl', 'ZPL')], string="Report Type", default="pdf", required=True)
|
||||
test_report_type = fields.Selection([('pdf', 'PDF'), ('zpl', 'ZPL')], string="Report Type",
|
||||
default="pdf", required=True)
|
||||
source_document = fields.Selection(
|
||||
selection=[('operation', 'Specific Page of Operation Worksheet'), ('step', 'Custom')],
|
||||
string="Step Document",
|
||||
@@ -125,20 +128,23 @@ class QualityPoint(models.Model):
|
||||
points_for_workorder_step = self.filtered(lambda p: p.operation_id and p.bom_id)
|
||||
for point in points_for_workorder_step:
|
||||
bom_product_ids = point.bom_id.product_id or point.bom_id.product_tmpl_id.product_variant_ids
|
||||
point.bom_product_ids = bom_product_ids.filtered(lambda p: not p.company_id or p.company_id == point.company_id._origin)
|
||||
point.bom_product_ids = bom_product_ids.filtered(lambda p: not p.company_id or
|
||||
p.company_id == point.company_id._origin)
|
||||
|
||||
@api.depends('product_ids', 'test_type_id', 'is_workorder_step')
|
||||
def _compute_component_ids(self):
|
||||
self.component_ids = False
|
||||
for point in self:
|
||||
if not point.is_workorder_step or not self.bom_id or point.test_type not in ('register_consumed_materials', 'register_byproducts'):
|
||||
if not point.is_workorder_step or not self.bom_id or point.test_type not in ('register_consumed_materials',
|
||||
'register_byproducts'):
|
||||
point.component_id = None
|
||||
continue
|
||||
if point.test_type == 'register_byproducts':
|
||||
point.component_ids = point.bom_id.byproduct_ids.product_id
|
||||
else:
|
||||
bom_products = point.bom_id.product_id or point.bom_id.product_tmpl_id.product_variant_ids
|
||||
# If product_ids is set the step will exist only for these product variant then we can filter out for the bom explode
|
||||
# If product_ids is set the step will exist only for these product variant then we can filter
|
||||
# out for the bom explode
|
||||
if point.product_ids:
|
||||
bom_products &= point.product_ids._origin
|
||||
|
||||
@@ -183,7 +189,8 @@ class QualityCheck(models.Model):
|
||||
|
||||
workorder_id = fields.Many2one(
|
||||
'mrp.workorder', 'Operation', check_company=True)
|
||||
workcenter_id = fields.Many2one('mrp.workcenter', related='workorder_id.workcenter_id', store=True, readonly=True) # TDE: necessary ?
|
||||
workcenter_id = fields.Many2one('mrp.workcenter', related='workorder_id.workcenter_id', store=True,
|
||||
readonly=True) # TDE: necessary ?
|
||||
production_id = fields.Many2one(
|
||||
'mrp.production', 'Production Order', check_company=True)
|
||||
|
||||
@@ -201,12 +208,14 @@ class QualityCheck(models.Model):
|
||||
component_uom_id = fields.Many2one('uom.uom', related='move_id.product_uom', readonly=True)
|
||||
|
||||
qty_done = fields.Float('Done', digits='Product Unit of Measure')
|
||||
finished_lot_id = fields.Many2one('stock.lot', 'Finished Lot/Serial', related='production_id.lot_producing_id', store=True)
|
||||
finished_lot_id = fields.Many2one('stock.lot', 'Finished Lot/Serial', related='production_id.lot_producing_id',
|
||||
store=True)
|
||||
additional = fields.Boolean('Register additional product', compute='_compute_additional')
|
||||
component_tracking = fields.Selection(related='component_id.tracking', string="Is Component Tracked")
|
||||
|
||||
# Workorder specific fields
|
||||
component_remaining_qty = fields.Float('Remaining Quantity for Component', compute='_compute_component_data', digits='Product Unit of Measure')
|
||||
component_remaining_qty = fields.Float('Remaining Quantity for Component', compute='_compute_component_data',
|
||||
digits='Product Unit of Measure')
|
||||
component_qty_to_do = fields.Float(compute='_compute_component_qty_to_do')
|
||||
is_user_working = fields.Boolean(related="workorder_id.is_user_working")
|
||||
consumption = fields.Selection(related="workorder_id.consumption")
|
||||
@@ -241,7 +250,8 @@ class QualityCheck(models.Model):
|
||||
super()._compute_title()
|
||||
for check in self:
|
||||
if not check.point_id or check.component_id:
|
||||
check.title = '{} "{}"'.format(check.test_type_id.display_name, check.component_id.name or check.workorder_id.name)
|
||||
check.title = '{} "{}"'.format(check.test_type_id.display_name, check.component_id.name
|
||||
or check.workorder_id.name)
|
||||
|
||||
@api.depends('point_id', 'quality_state', 'component_id', 'component_uom_id', 'lot_id', 'qty_done')
|
||||
def _compute_result(self):
|
||||
@@ -266,7 +276,8 @@ class QualityCheck(models.Model):
|
||||
|
||||
def _get_check_result(self):
|
||||
if self.test_type in ('register_consumed_materials', 'register_byproducts') and self.lot_id:
|
||||
return '{} - {}, {} {}'.format(self.component_id.name, self.lot_id.name, self.qty_done, self.component_uom_id.name)
|
||||
return '{} - {}, {} {}'.format(self.component_id.name, self.lot_id.name, self.qty_done,
|
||||
self.component_uom_id.name)
|
||||
elif self.test_type in ('register_consumed_materials', 'register_byproducts'):
|
||||
return '{}, {} {}'.format(self.component_id.name, self.qty_done, self.component_uom_id.name)
|
||||
else:
|
||||
@@ -281,12 +292,14 @@ class QualityCheck(models.Model):
|
||||
for check in self:
|
||||
if check.test_type in ('register_byproducts', 'register_consumed_materials'):
|
||||
if check.quality_state == 'none':
|
||||
completed_lines = check.workorder_id.move_line_ids.filtered(lambda l: l.lot_id) if check.component_id.tracking != 'none' else check.workorder_id.move_line_ids
|
||||
completed_lines = check.workorder_id.move_line_ids.filtered(lambda l: l.lot_id)\
|
||||
if check.component_id.tracking != 'none' else check.workorder_id.move_line_ids
|
||||
if check.move_id.additional:
|
||||
qty = check.workorder_id.qty_remaining
|
||||
else:
|
||||
qty = check.workorder_id.qty_producing
|
||||
check.component_remaining_qty = self._prepare_component_quantity(check.move_id, qty) - sum(completed_lines.mapped('qty_done'))
|
||||
check.component_remaining_qty = self._prepare_component_quantity(check.move_id, qty) -\
|
||||
sum(completed_lines.mapped('qty_done'))
|
||||
check.component_uom_id = check.move_id.product_uom
|
||||
|
||||
def action_print(self):
|
||||
@@ -369,7 +382,8 @@ class QualityCheck(models.Model):
|
||||
vals_list = []
|
||||
# apply putaway
|
||||
location_dest_id = self.move_id.location_dest_id._get_putaway_strategy(self.move_id.product_id)
|
||||
quants = self.env['stock.quant']._gather(self.product_id, self.move_id.location_id, lot_id=self.lot_id, strict=False)
|
||||
quants = self.env['stock.quant']._gather(self.product_id, self.move_id.location_id, lot_id=self.lot_id,
|
||||
strict=False)
|
||||
# Search for a sub-locations where the product is available.
|
||||
# Loop on the quants to get the locations. If there is not enough
|
||||
# quantity into stock, we take the move location. Anyway, no
|
||||
@@ -386,7 +400,8 @@ class QualityCheck(models.Model):
|
||||
for quant in quants:
|
||||
vals = shared_vals.copy()
|
||||
quantity = quant.quantity - quant.reserved_quantity
|
||||
quantity = self.product_id.uom_id._compute_quantity(quantity, self.product_uom_id, rounding_method='HALF-UP')
|
||||
quantity = self.product_id.uom_id._compute_quantity(quantity, self.product_uom_id,
|
||||
rounding_method='HALF-UP')
|
||||
rounding = quant.product_uom_id.rounding
|
||||
if (float_compare(quant.quantity, 0, precision_rounding=rounding) <= 0 or
|
||||
float_compare(quantity, 0, precision_rounding=self.product_uom_id.rounding) <= 0):
|
||||
@@ -469,7 +484,8 @@ class QualityCheck(models.Model):
|
||||
|
||||
def _update_component_quantity(self):
|
||||
if self.component_tracking == 'serial':
|
||||
self._origin.qty_done = self.component_id.uom_id._compute_quantity(1, self.component_uom_id, rounding_method='HALF-UP')
|
||||
self._origin.qty_done = self.component_id.uom_id._compute_quantity(1, self.component_uom_id,
|
||||
rounding_method='HALF-UP')
|
||||
return
|
||||
move = self.move_id
|
||||
# Compute the new quantity for the current component
|
||||
|
||||
@@ -5,4 +5,4 @@ from odoo import fields, models
|
||||
class Users(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
workcenter_ids = fields.Many2many("mrp.workcenter", 'users_workcenter')
|
||||
workcenter_ids = fields.Many2many("mrp.workcenter", 'users_workcenter')
|
||||
|
||||
@@ -125,7 +125,8 @@ class StockRule(models.Model):
|
||||
moves_values_by_company[procurement.company_id.id].append(move_values)
|
||||
|
||||
for company_id, moves_values in moves_values_by_company.items():
|
||||
# create the move as SUPERUSER because the current user may not have the rights to do it (mto product launched by a sale for example)
|
||||
# create the move as SUPERUSER because the current user may not have the rights to do it (mto product
|
||||
# launched by a sale for example)
|
||||
moves = self.env['stock.move'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create(moves_values)
|
||||
# Since action_confirm launch following procurement_group we should activate it.
|
||||
moves._action_confirm()
|
||||
@@ -148,7 +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)
|
||||
@@ -162,7 +164,8 @@ class StockRule(models.Model):
|
||||
|
||||
productions.filtered(lambda p: (not p.orderpoint_id and p.move_raw_ids) or \
|
||||
(
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and not p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
p.move_dest_ids.procure_method != 'make_to_order' and not
|
||||
p.move_raw_ids and not p.workorder_ids)).action_confirm()
|
||||
|
||||
for production in productions:
|
||||
'''
|
||||
@@ -404,8 +407,8 @@ class ReStockMove(models.Model):
|
||||
'fixture_clamp_workpiece_diameter_max': item.product_id.fixture_clamp_workpiece_diameter_max,
|
||||
'fixture_maximum_carrying_weight': item.product_id.fixture_maximum_carrying_weight,
|
||||
'fixture_maximum_clamping_force': item.product_id.fixture_maximum_clamping_force,
|
||||
'fixture_driving_way': '' if not item.product_id.fixture_driving_way else
|
||||
item.product_id.fixture_driving_way,
|
||||
'fixture_driving_way': '' if not item.product_id.fixture_driving_way
|
||||
else item.product_id.fixture_driving_way,
|
||||
'fixture_apply_machine_tool_type_codes': self.env[
|
||||
'product.template']._json_apply_machine_tool_type_item_code(item),
|
||||
'fixture_through_hole_size': item.product_id.fixture_through_hole_size,
|
||||
@@ -464,14 +467,14 @@ class ReStockMove(models.Model):
|
||||
'blade_tip_taper': item.product_id.cutting_tool_blade_tip_taper,
|
||||
'blade_helix_angle': item.product_id.cutting_tool_blade_helix_angle,
|
||||
'blade_type': item.product_id.cutting_tool_blade_type,
|
||||
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False else
|
||||
item.product_id.cutting_tool_coarse_medium_fine,
|
||||
'coarse_medium_fine': '' if item.product_id.cutting_tool_coarse_medium_fine is False
|
||||
else item.product_id.cutting_tool_coarse_medium_fine,
|
||||
'run_out_accuracy_max': item.product_id.cutting_tool_run_out_accuracy_max,
|
||||
'run_out_accuracy_min': item.product_id.cutting_tool_run_out_accuracy_min,
|
||||
'head_diameter': item.product_id.cutting_tool_head_diameter,
|
||||
'diameter': item.product_id.cutting_tool_diameter,
|
||||
'blade_number': '' if item.product_id.cutting_tool_blade_number is False else
|
||||
item.product_id.cutting_tool_blade_number,
|
||||
'blade_number': '' if item.product_id.cutting_tool_blade_number is False
|
||||
else item.product_id.cutting_tool_blade_number,
|
||||
'front_angle': item.product_id.cutting_tool_front_angle,
|
||||
'rear_angle': item.product_id.cutting_tool_rear_angle,
|
||||
'main_included_angle': item.product_id.cutting_tool_main_included_angle,
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_sf_cnc_processing,sf_cnc_processing,model_sf_cnc_processing,base.group_user,1,1,1,1
|
||||
access_sf_model_type,sf_model_type,model_sf_model_type,base.group_user,1,1,1,1
|
||||
access_sf_product_model_type_routing_sort,sf_product_model_type_routing_sort,model_sf_product_model_type_routing_sort,base.group_user,1,1,1,1
|
||||
access_sf_embryo_model_type_routing_sort,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,base.group_user,1,1,1,1
|
||||
access_sf_surface_technics_model_type_routing_sort,sf_surface_technics_model_type_routing_sort,model_sf_surface_technics_model_type_routing_sort,base.group_user,1,1,1,1
|
||||
access_sf_production_line,sf.production.line,model_sf_production_line,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment_tool,maintenance_equipment_tool,model_maintenance_equipment_tool,base.group_user,1,1,1,1
|
||||
access_sf_cnc_processing,sf_cnc_processing,model_sf_cnc_processing,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cnc_processing_manager,sf_cnc_processing,model_sf_cnc_processing,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_sf_model_type,sf_model_type,model_sf_model_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_model_type_manager,sf_model_type,model_sf_model_type,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_sf_product_model_type_routing_sort,sf_product_model_type_routing_sort,model_sf_product_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_product_model_type_routing_sort_manager,sf_product_model_type_routing_sort,model_sf_product_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_sf_embryo_model_type_routing_sort,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_embryo_model_type_routing_sort_manager,sf_embryo_model_type_routing_sort,model_sf_embryo_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_sf_surface_technics_model_type_routing_sort,sf_surface_technics_model_type_routing_sort,model_sf_surface_technics_model_type_routing_sort,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_surface_technics_model_type_routing_sort_manager,sf_surface_technics_model_type_routing_sort,model_sf_surface_technics_model_type_routing_sort,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_sf_production_line,sf.production.line,model_sf_production_line,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_production_line_manager,sf.production.line,model_sf_production_line,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_maintenance_equipment_tool,maintenance_equipment_tool,model_maintenance_equipment_tool,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_maintenance_equipment_tool_manager,maintenance_equipment_tool,model_maintenance_equipment_tool,sf_base.group_sf_mrp_manager,1,1,1,1
|
||||
access_mrp_production,mrp_production,model_mrp_production,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_mrp_production_manager,mrp_production,model_mrp_production,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_mrp_workorder_manager,mrp_workorder,model_mrp_workorder,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||
access_mrp_workcenter,mrp_workcenter,model_mrp_workcenter,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_mrp_workcenter_manager,mrp_workcenter,model_mrp_workcenter,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||
access_mrp_workcenter_productivity,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_mrp_workcenter_productivity_manager,mrp_workcenter_productivity,model_mrp_workcenter_productivity,sf_base.group_sf_mrp_manager,1,1,1,0
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -13,9 +13,9 @@ class CustomKanbanController extends KanbanController {
|
||||
|
||||
async setup() {
|
||||
super.setup();
|
||||
console.log('99999999111');
|
||||
// console.log('99999999111');
|
||||
this.workOrders = await this.getAllWorkOrders();
|
||||
this.workOrdersNew = this.workOrders;
|
||||
// this.workOrdersNew = this.workOrders;
|
||||
// console.log('lines222222222', this.workOrders);
|
||||
//
|
||||
// console.log(typeof this.workOrders);
|
||||
@@ -39,14 +39,14 @@ class CustomKanbanController extends KanbanController {
|
||||
const id = button.getAttribute('data-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', {
|
||||
model: 'mrp.workcenter',
|
||||
method: 'search_read',
|
||||
args: [[], ['id']],
|
||||
kwargs: {}
|
||||
}).then((records) => {
|
||||
console.log(records)
|
||||
// console.log(records)
|
||||
const ids = records.map(record => record.id);
|
||||
const context = {production_line_show: id};
|
||||
this.env.services.rpc('/web/dataset/call_kw', {
|
||||
@@ -55,7 +55,7 @@ class CustomKanbanController extends KanbanController {
|
||||
args: [ids, context],
|
||||
kwargs: {}
|
||||
}).then((response) => {
|
||||
console.log('response', response);
|
||||
// console.log('response', response);
|
||||
location.reload();
|
||||
window.onload = function () {
|
||||
button.classList.add('choose')
|
||||
@@ -77,7 +77,7 @@ class CustomKanbanController extends KanbanController {
|
||||
// args: [],
|
||||
// kwargs: {},
|
||||
// });
|
||||
console.log('response', response);
|
||||
// console.log('response', response);
|
||||
// console.log('response1', response1);
|
||||
// 你可以在这里处理响应,例如将其存储在控制器的状态中
|
||||
return response;
|
||||
|
||||
33
sf_manufacturing/views/mrp_views_menus.xml
Normal file
33
sf_manufacturing/views/mrp_views_menus.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<menuitem id="mrp.menu_mrp_root"
|
||||
name="Manufacturing"
|
||||
groups="mrp.group_mrp_user,mrp.group_mrp_manager,sf_base.group_sf_mrp_user,sf_base.group_sf_mrp_manager"
|
||||
web_icon="mrp,static/description/icon.svg"
|
||||
sequence="145">
|
||||
|
||||
<menuitem id="mrp.menu_mrp_manufacturing"
|
||||
name="Operations"
|
||||
sequence="10"/>
|
||||
|
||||
<menuitem id="mrp.mrp_planning_menu_root"
|
||||
name="Planning"
|
||||
sequence="15"/>
|
||||
|
||||
<menuitem id="mrp.enu_mrp_bom"
|
||||
name="Products"
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem id="mrp.menu_mrp_reporting"
|
||||
name="Reporting"
|
||||
sequence="25"/>
|
||||
|
||||
<menuitem id="mrp.menu_mrp_configuration"
|
||||
name="Configuration"
|
||||
groups="mrp.group_mrp_manager,sf_base.group_sf_mrp_manager"
|
||||
sequence="100"/>
|
||||
|
||||
</menuitem>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -89,7 +89,7 @@
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="inherit_id" ref="sf_maintenance.sf_hr_equipment_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='brand_id']" position="after">
|
||||
<xpath expr="//field[@name='type_id']" position="after">
|
||||
<field name="production_line_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user