1.产品新增计划岗权限,页面部分字段新增只读控制2.采购优化确认订单按钮
This commit is contained in:
@@ -101,23 +101,9 @@ class RePurchaseOrder(models.Model):
|
||||
vals['check_status'] = 'approved'
|
||||
return super().write(vals)
|
||||
|
||||
# @api.model_create_multi
|
||||
# def create(self, vals_list):
|
||||
# # res = super().create(vals_list)
|
||||
# if self.env.user.has_group('sf_base.group_purchase'):
|
||||
# view = self.env.ref('sf_sale.action_purchase_order_submit_wizard')
|
||||
# return {
|
||||
# 'name': _('确认?'),
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# 'view_mode': 'form',
|
||||
# 'res_model': 'purchase.order.wizard',
|
||||
# 'views': [(view.id, 'form')],
|
||||
# 'view_id': view.id,
|
||||
# 'target': 'new',
|
||||
# 'context': dict(self.env.context),
|
||||
# }
|
||||
# res = super().create(vals_list)
|
||||
# return res
|
||||
def button_confirm(self):
|
||||
self.check_status = 'pending'
|
||||
return super().button_confirm()
|
||||
|
||||
|
||||
class ResPartnerToSale(models.Model):
|
||||
|
||||
@@ -9,9 +9,11 @@ access_crm_team_member_manager,crm_team_manager,sales_team.model_crm_team,sf_bas
|
||||
access_crm_team_member_director,crm_team_member_director,sales_team.model_crm_team_member,sf_base.group_sale_director,1,1,1,0
|
||||
access_res_users,res_users,base.model_res_users,sf_base.group_sale_director,1,1,1,0
|
||||
access_product_template_group_sale_salemanager,product_template_group_sale_salemanager,product.model_product_template,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,0,0,0
|
||||
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,1,1,0
|
||||
access_product_template_group_purchase,product_template_group_purchase,product.model_product_template,sf_base.group_purchase,1,0,0,0
|
||||
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,0,0,0
|
||||
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,1,1,0
|
||||
access_product_template_group_plan_dispatch,product_template_group_plan_dispatch,product.model_product_template,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_product_template_group_plan_director,product_template_group_plan_director,product.model_product_template,sf_base.group_plan_director,1,1,1,0
|
||||
access_stock_picking_group_sale_salemanager,stock_picking_group_sale_salemanager,stock.model_stock_picking,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_picking_group_sale_director,stock_picking_group_sale_director,stock.model_stock_picking,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,0,0,0
|
||||
|
||||
|
@@ -9,7 +9,8 @@
|
||||
<field name="currency_id" position="after">
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <field name="state"/>-->
|
||||
<field name="remark"/>
|
||||
<field name="remark" attrs="{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['pending','approved'])]}"/>
|
||||
</field>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
|
||||
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
|
||||
@@ -20,7 +21,7 @@
|
||||
<xpath expr="//form/header/button[@name='button_confirm'][2]" position="replace">
|
||||
<button name="button_confirm" type="object" context="{'validate_analytic': True}"
|
||||
string="确认订单" id="draft_confirm"
|
||||
attrs="{'invisible': ['|','&',('check_status','in', ['approved','fail']),('state', 'in', ['draft','purchase']),('check_status','=',False ),('state', 'in', ['purchase'])]}"
|
||||
attrs="{'invisible': ['|','&',('check_status','in', ['approved','fail','pending']),('state', 'in', ['draft','purchase']),('state', 'in', ['purchase'])]}"
|
||||
/>
|
||||
</xpath>
|
||||
|
||||
@@ -65,42 +66,42 @@
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<field name="partner_ref" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="date_planned" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="receipt_reminder_email" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="user_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="origin" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="payment_term_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="fiscal_position_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
@@ -114,12 +115,12 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="incoterm_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="incoterm_location" position="attributes">
|
||||
<attribute name="attrs">{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['approved'])]}
|
||||
['pending','approved'])]}
|
||||
</attribute>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user