[IMP] visual improvement: set the SIRET to SIREN+'*****' when the NIC is empty. Use the style from v8 to hide the SIRET in edit view, instead of our own custom style

This commit is contained in:
Lionel Sausin
2014-03-27 11:04:12 +01:00
parent cb0156b2ca
commit 607be79004
2 changed files with 9 additions and 10 deletions

View File

@@ -41,13 +41,9 @@ class Partner(orm.Model):
def _get_siret(self, cr, uid, ids, field_name, arg, context=None):
"""Concatenate the SIREN and NIC to form the SIRET"""
sirets = {}
for partner in self.browse(cr, uid, ids, context=context):
if partner.siren and partner.nic:
sirets[partner.id] = '%s%s' % (partner.siren, partner.nic)
else:
sirets[partner.id] = ''
return sirets
return {partner.id: '%s%s' % (partner.siren, partner.nic or '*****')
if partner.siren else ''
for partner in self.browse(cr, uid, ids, context=context)}
def _check_siret(self, cr, uid, ids):
"""Check the SIREN's and NIC's keys (last digits)"""

View File

@@ -10,9 +10,12 @@
<page string="Accounting" position="inside">
<group>
<group col="4">
<!-- oe_view_only hides the field in edit mode if this patch applied:
lp:~numerigraphe-team/openerp-web/7.0-hide-oe_view_only -->
<field name="siret" colspan="4" class="oe_view_only" />
<!-- oe_read_only hides the field in read mode
in v8+. v7.0 shows the field - no big deal.
Those who care can patch the web client:
lp:~numerigraphe-team/ocb-web/7.0-hide-oe_read_only
-->
<field name="siret" colspan="4" class="oe_read_only" />
<field name="siren" class="oe_edit_only" string="SIREN/NIC" colspan="3"/>
<field name="nic" class="oe_edit_only" nolabel="1"/>
</group>