Browse Source

[ADD] try if we can have our cake and eat it

pull/480/head
Holger Brunn 8 years ago
parent
commit
2b32875b3f
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 2
      field_rrule/README.rst
  2. 3
      field_rrule/__init__.py
  3. 6
      field_rrule/__openerp__.py
  4. 4
      field_rrule/demo/__init__.py
  5. 2
      field_rrule/demo/res_partner.xml

2
field_rrule/README.rst

@ -17,7 +17,7 @@ To use this module, you need to:
* say ``from openerp.addons.field_rrule import FieldRRule``
* use ``FieldRRule`` like any other field
* on forms, use ``widget="rrule"``
* have a look at `demo/res_partner.*`
* have a look at ``demo/res_partner.*``
Technically, this is a wrapper around serialized fields. The value always will be a subclass of dateutil's ``rruleset``. For technical reasons, this class overrides ``__iter__``, so if you need a proper ``rruleset``, call the value: ``my_browse_record.my_field_of_type_rrule()`` - this gives you a vanilla ``rruleset``.

3
field_rrule/__init__.py

@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import socket
from .field_rrule import FieldRRule
if socket.getfqdn().endswith('odoo-community.org'):
import demo

6
field_rrule/__openerp__.py

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import socket
{
"name": "Repetition Rules",
"version": "8.0.1.0.0",
@ -14,6 +16,10 @@
"data": [
'views/templates.xml',
],
"demo": [] if not socket.getfqdn().endswith('odoo-community.org')
else [
'demo/res_partner.xml'
],
"qweb": [
'static/src/xml/field_rrule.xml',
],

4
field_rrule/demo/__init__.py

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# © 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import res_partner

2
field_rrule/demo/res_partner.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="d" model="ir.ui.view">
<record id="view_partner_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">

Loading…
Cancel
Save