Coder Social home page Coder Social logo

odoo-attrs-replace's Introduction

Odoo Attrs replacer

As Odoo changed the attrs to (no more attrs) in v17, I created this little script to help you replace all attrs in your XML files with corresponding attributes in the XML directly.

Dependencies

Simply install with

pip install beautifulsoup4 lxml

OR

pip install -r requirements.txt

Usage

Launch the python script

python3 replace_attrs.py

It will ask you the root directory to check for XML files. You can give a project's absolute path.

If no arguments are given, it will use the current directory.

The script will ask you, for each file, if you want to replace all attrs= and states= with related attrs (invisible,readonly,required,column_invisible) - (invisible concatenation or creation for states) in the tag (for all instances per tag).

Unless you chose in the beginning 'y' for auto-replace (don't ask for each file)

Found a flaw ?

Please open an Issue or make a PR or contact me on LinkedIn (Pierre Locus)

Please include a Minimal Reproducible Example in your PR if you find a bug.

Thanks in advance!

TODO:

  • Support missing operators "=?", "child_of", "parent_of" (less used than the others already supported)

Contributors

Thank you for your contributions:

  • @lorenuars19 for the better README
  • @artygo8 for the faster and cleaner get_files_recursive function

odoo-attrs-replace's People

Contributors

lop-nalios avatar pierrelocus avatar artygo8 avatar lorenuars19 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.