Update internal_property
This commit is contained in:
parent
c1d86dd6bb
commit
e34d615dc0
|
|
@ -7,8 +7,8 @@
|
|||
##############################################################################
|
||||
|
||||
import base64
|
||||
# import json
|
||||
# from lxml import etree
|
||||
import json
|
||||
from lxml import etree
|
||||
import re
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
from odoo.modules.module import get_module_resource
|
||||
|
|
@ -31,7 +31,18 @@ class Property(models.Model):
|
|||
('non_residential', 'Non-Residential'),
|
||||
], string="Property Suitability for Residence")
|
||||
|
||||
|
||||
@api.model
|
||||
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
|
||||
res = super(Property, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar,
|
||||
submenu=submenu)
|
||||
doc = etree.XML(res['arch'])
|
||||
if (view_type == 'form'):
|
||||
for node in doc.xpath("//field"):
|
||||
modifiers = json.loads(node.get("modifiers"))
|
||||
modifiers['readonly'] = [('state', 'in', ['approve'])]
|
||||
node.set("modifiers", json.dumps(modifiers))
|
||||
res['arch'] = etree.tostring(doc, encoding='unicode')
|
||||
return res
|
||||
|
||||
|
||||
def _compute_maintenance_count(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue