修复客户页面除销售员和采购员字段可编辑,其余不可编辑
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo import fields, models, api
|
||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
# from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -5,8 +5,8 @@ import os
|
||||
import json
|
||||
from datetime import datetime
|
||||
import requests
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="delete">false</attribute>
|
||||
<attribute name="edit">false</attribute>
|
||||
<!-- <attribute name="edit">false</attribute>-->
|
||||
</form>
|
||||
<field name="vat" position="after">
|
||||
<field name="customer_rank" invisible="1"/>
|
||||
@@ -16,42 +16,71 @@
|
||||
</field>
|
||||
<field name="vat" position="attributes">
|
||||
<attribute name="required">1</attribute>
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="email" position="replace">
|
||||
<field name="email" attrs="{'required' : [('customer_rank','>', 0)]}"/>
|
||||
<field name="email"
|
||||
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('id','!=', False)]}"/>
|
||||
</field>
|
||||
<field name="mobile" position="attributes">
|
||||
<attribute name="attrs">{'required': [('phone', '=', False)]}
|
||||
<attribute name="attrs">{'required': [('phone', '=', False)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="phone" position="attributes">
|
||||
<attribute name="attrs">{'required': [('mobile', '=', False)]}
|
||||
<attribute name="attrs">{'required': [('mobile', '=', False)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="street" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="street2" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="city" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="country_id" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)]}
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
||||
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"
|
||||
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('supplier_rank','>', 0)]}"/>
|
||||
attrs="{'required' : [('customer_rank','>', 0)]}"/>
|
||||
</xpath>
|
||||
<field name="category_id" position="attributes">
|
||||
<attribute name="required">1</attribute>
|
||||
<!-- <attribute name="attrs">{'required': ['|',('customer_rank','>', 0),('supplier_rank','>', 0)]}</attribute>-->
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="company_registry" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="ref" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="company_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="industry_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="comment" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="zip" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="website" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<field name="lang" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</field>
|
||||
<xpath expr="//field[@name='child_ids']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user