Browse Source

Can set Py3o servers as inactive

--HG--
branch : odoo8
pull/80/head
Jérémie Gavrel 9 years ago
parent
commit
7e9a76558c
  1. 7
      models/py3o_server.py
  2. 2
      py3o_parser.py
  3. 2
      views/py3o_server.xml

7
models/py3o_server.py

@ -9,4 +9,11 @@ class py3o_server(osv.Model):
u"URL", u"URL",
size=256, size=256,
), ),
'is_active': fields.boolean(
u"Active",
)
}
_defaults = {
'is_active': True,
} }

2
py3o_parser.py

@ -158,7 +158,7 @@ class Py3oParser(report_sxw):
fusion_server_obj = pool.get('py3o.server') fusion_server_obj = pool.get('py3o.server')
fusion_server_ids = fusion_server_obj.search( fusion_server_ids = fusion_server_obj.search(
cr, uid, [], context=context, limit=1
cr, uid, [('is_active', '=', True)], context=context, limit=1
) )
if not fusion_server_ids: if not fusion_server_ids:
if filetype.fusion_ext == report_xml.py3o_template_id.filetype: if filetype.fusion_ext == report_xml.py3o_template_id.filetype:

2
views/py3o_server.xml

@ -9,6 +9,7 @@
<sheet> <sheet>
<group> <group>
<field name="url" /> <field name="url" />
<field name="is_active" />
</group> </group>
</sheet> </sheet>
</form> </form>
@ -21,6 +22,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Py3o Server Configuration" version="7.0"> <tree string="Py3o Server Configuration" version="7.0">
<field name="url" /> <field name="url" />
<field name="is_active" />
</tree> </tree>
</field> </field>
</record> </record>

Loading…
Cancel
Save