新增产线类型方法校验
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['sf_plan','jikimo_printing'],
|
||||
'depends': ['sf_plan', 'jikimo_printing'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/stock_route_group.xml',
|
||||
@@ -20,6 +20,7 @@
|
||||
'views/sale_order_views.xml',
|
||||
'wizard/sf_demand_plan_print_wizard_view.xml',
|
||||
'wizard/sf_release_plan_wizard_views.xml',
|
||||
'wizard/sf_demand_plan_detail_wizard_view.xml',
|
||||
'views/menu_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -911,5 +911,25 @@ class SfProductionDemandPlan(models.Model):
|
||||
}
|
||||
return values
|
||||
|
||||
@api.model
|
||||
def check_other_custom_made_demands(self, plan_id, product_id, custom_made_type):
|
||||
return bool(self.env['sf.production.demand.plan'].sudo().search_count([
|
||||
('product_id', '=', product_id),
|
||||
('id', '!=', plan_id),
|
||||
('new_supply_method', '=', 'custom_made'),
|
||||
('status', '=', '30'),
|
||||
('custom_made_type', '!=', custom_made_type),
|
||||
], limit=1))
|
||||
|
||||
def button_plan_detail(self):
|
||||
pass
|
||||
return {
|
||||
'name': _('详情'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sf.demand.plan.detail.wizard',
|
||||
'target': 'new',
|
||||
'views': [(False, 'form')],
|
||||
'context': {
|
||||
'default_demand_plan_line_ids': self.ids,
|
||||
'default_mrp_production_ids': self.mrp_production_ids.ids,
|
||||
}}
|
||||
|
||||
@@ -13,4 +13,7 @@ access_stock_route_group,stock.route.group,model_stock_route_group,base.group_us
|
||||
access_stock_route_group_dispatch,stock.route.group.dispatch,model_stock_route_group,sf_base.group_plan_dispatch,1,1,0,0
|
||||
|
||||
access_sf_release_plan_wizard,sf.release.plan.wizard,model_sf_release_plan_wizard,base.group_user,1,0,0,0
|
||||
access_sf_release_plan_wizard_for_dispatch,sf.release.plan.wizard for dispatch,model_sf_release_plan_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
||||
access_sf_release_plan_wizard_for_dispatch,sf.release.plan.wizard for dispatch,model_sf_release_plan_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
||||
|
||||
access_sf_demand_plan_detail_wizard,sf.demand.plan.detail.wizard,model_sf_demand_plan_detail_wizard,base.group_user,1,0,0,0
|
||||
access_sf_demand_plan_detail_wizard_for_dispatch,sf.demand.plan.detail.wizard for dispatch,model_sf_demand_plan_detail_wizard,sf_base.group_plan_dispatch,1,1,1,1
|
||||
|
@@ -1,2 +1,3 @@
|
||||
from . import sf_demand_plan_print_wizard
|
||||
from . import sf_release_plan_wizard
|
||||
from . import sf_demand_plan_detail_wizard
|
||||
|
||||
15
sf_demand_plan/wizard/sf_demand_plan_detail_wizard.py
Normal file
15
sf_demand_plan/wizard/sf_demand_plan_detail_wizard.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SfDemandPlanDetailWizard(models.TransientModel):
|
||||
_name = 'sf.demand.plan.detail.wizard'
|
||||
_description = u'需求计划详情向导'
|
||||
|
||||
demand_plan_line_ids = fields.Many2many(comodel_name="sf.production.demand.plan",
|
||||
string="需求计划明细", readonly=True)
|
||||
|
||||
mrp_production_ids = fields.Many2many('mrp.production', string='关联制造订单', readonly=True)
|
||||
21
sf_demand_plan/wizard/sf_demand_plan_detail_wizard_view.xml
Normal file
21
sf_demand_plan/wizard/sf_demand_plan_detail_wizard_view.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="action_plan_detail_form" model="ir.ui.view">
|
||||
<field name="name">sf.demand.plan.detail.wizard.form</field>
|
||||
<field name="model">sf.demand.plan.detail.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="详情">
|
||||
<notebook>
|
||||
<page string="制造订单">
|
||||
<field name="mrp_production_ids"
|
||||
widget="many2many"
|
||||
options="{
|
||||
'views': [[false, 'tree'], [false, 'form']],
|
||||
'context': {'tree_view_ref': 'mrp.mrp_production_tree_view'}
|
||||
}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -5,7 +5,7 @@ from odoo import models, fields, api, _
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SfDemandPlanPrintWizard(models.TransientModel):
|
||||
class SfDemandPlanPrintWizard(models.Model):
|
||||
_name = 'sf.demand.plan.print.wizard'
|
||||
_description = u'打印向导'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user