Skip to content

7.0 web field masks - #34

Closed
menecio wants to merge 3 commits into
OCA:7.0from
menecio:7.0-web_field_masks
Closed

menecio wants to merge 3 commits into
OCA:7.0from
menecio:7.0-web_field_masks

Conversation

@menecio

@menecio menecio commented Aug 27, 2014

Copy link
Copy Markdown

Added web_field_masks module

@hbrunn

hbrunn commented Sep 1, 2014

Copy link
Copy Markdown
Member

./web_fields_masks/openerp.py:8:80: E501 line too long (80 > 79 characters)

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same when pulling aa51d18 on menecio:7.0-web_field_masks into 4e3098f on OCA:7.0.

@hbrunn

hbrunn commented Oct 6, 2014

Copy link
Copy Markdown
Member

👍

@legalsylvain legalsylvain added this to the 7.0 milestone Oct 14, 2014
@legalsylvain

Copy link
Copy Markdown
Contributor

Hi,
I tried this module that works pretty good. Two points:
1/ It doesn't work on a tree view editable:

    <record id="view_id" model="ir.ui.view">
        <field name="model">my.model</field>
        <field name="arch" type="xml">
            <tree string="My Model" editable="bottom">
                <field name="description" data-inputmask="'mask': '99:99'"/>
            </tree>
        </field>
    </record>

This code return, when updating my module:

2014-10-14 ERROR DBNAME openerp.addons.base.ir.ir_ui_view: <string>:7:0:ERROR:RELAXNGV:RELAXNG_ERR_NOELEM: Expecting an element diagram, got nothing
2014-10-14 ERROR DBNAME openerp.addons.base.ir.ir_ui_view: <string>:7:0:ERROR:RELAXNGV:RELAXNG_ERR_INVALIDATTR: Invalid attribute data-inputmask for element field
2014-10-14 ERROR DBNAME openerp.addons.base.ir.ir_ui_view: <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_EXTRACONTENT: Element tree has extra content: field
2014-10-14 23:24:18,080 25427 ERROR DBNAME openerp.tools.convert: Parse error in /my_path/view/view.xml:146: 

-> I don't know if it is easy to improve your module to work in editable tree view. Otherwise, Can you write this limitation in the description of the module ?

2/ Some User cases:

  • I have a database with an bad email like 'test@gmail' without ".com" in the email field of a res partner;
  • I install your module and write a module to set this field with the 'alias' 'email';
  • I edit the partner and change another field, then save;
    -> The value of email is now 'bob@gmail.__'

More generaly, if the field is not correctly filled, the field become red, but it is possible to save.
Is it the expected behaviour ?
For exemple, it is possible to write an ip like '123.021.'

Regards.
(functional test, no code review)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reacting to #34 (comment), it probably would make sense to do this by overriding is_syntax_valid - then you get the classes for free and the standard mechanism would force you to correct the value

@eLBati

eLBati commented Nov 20, 2014

Copy link
Copy Markdown
Member

Thanks @menecio , does this support the 'regex-mask'?

@menecio

menecio commented Dec 16, 2014

Copy link
Copy Markdown
Author

Sorry I didn't receive any notifications about this in my mail.

About working on editable list views, I only extended view_form.js, so it will need extra work to add compatibility with view_list

@legalsylvain

Copy link
Copy Markdown
Contributor

@menecio : No problem about limitation, but can you only write it in _ _ openerp _ _ file ?

And what about other remarks ?

Regards.

@lmignon

lmignon commented Mar 9, 2015

Copy link
Copy Markdown
Contributor

@menecio Thank you for the contribution. Same question as @legalsylvain :

If the field is not correctly filled, the field become red, but it is possible to save.
Is it the expected behaviour ?

@hbrunn

hbrunn commented Apr 6, 2016

Copy link
Copy Markdown
Member

closing due to inactivity

@hbrunn hbrunn closed this Apr 6, 2016
BT-fgarbely pushed a commit to BT-fgarbely/web that referenced this pull request Apr 3, 2018
Syncing from upstream OCA/web (10.0)
leemannd pushed a commit to camptocamp/web that referenced this pull request May 29, 2018
Fixes: Fixed product price and computed quantity for condition
vrenaville pushed a commit to camptocamp/web that referenced this pull request Jul 19, 2018
Enable sync task from odoo-template
phongdao pushed a commit to phongdao/web that referenced this pull request Jan 17, 2020
phongdao pushed a commit to phongdao/web that referenced this pull request Jan 17, 2020
davidtranhp added a commit to davidtranhp/web that referenced this pull request Feb 7, 2024
davidtranhp pushed a commit to davidtranhp/web that referenced this pull request Feb 7, 2024
davidtranhp pushed a commit to davidtranhp/web that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants