Skip to main content

mds-irrulecontext

Tryton module to add values to context of ir.rule.

Install

pip install mds-irrulecontext

How To

Add your model_names using _context_modelnames(), the module will then add the value user_id to the context of ir.rule. If company is installed, the ID of company and employee will be in the context. Use _get_context_values() to add additional values to context of ir.rule:

class IrRule(metaclass=PoolMeta):
    __name__ = 'ir.rule'

    @classmethod
    def _context_modelnames(cls):
        """ add model_name to context
        """
        result = super(IrRule, cls)._context_modelnames()
        result |= {'modelname1', 'modelname2'}
        return result

    @classmethod
    def _get_context_values(cls, model_name):
        """ add values to context
        """
        result = super(IrRule, cls)._get_context_values(model_name)

        if model_name == 'modelname1':
            result['key1'] = 'value1'
        elif model_name == 'modelname2':
            result['key2'] = 'value2'
        return result

Requires

  • Tryton 7.0

Changes

7.0.2 - 03.08.2026

7.0.1 - 05.07.2024

  • works

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mds_irrulecontext-7.0.2.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mds_irrulecontext-7.0.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file mds_irrulecontext-7.0.2.tar.gz.

File metadata

  • Download URL: mds_irrulecontext-7.0.2.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for mds_irrulecontext-7.0.2.tar.gz
Algorithm Hash digest
SHA256 a65675020115f04696de527069ec5b1ee6090ceab783c039477e6c42e824b80f
MD5 131d3d9efc300f038b65ead16dfb3c7f
BLAKE2b-256 fc9057fb2171138a032a991a9d4dae37235bf25d00dda3ca0747977d85d38f00

See more details on using hashes here.

File details

Details for the file mds_irrulecontext-7.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mds_irrulecontext-7.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b41ec22b13a103942c3a2a25051adf924fb921eaef676e7d73abf31aabb95f
MD5 280194a168772b8d95612949c0f31768
BLAKE2b-256 68c94e312841c22c67b2239315856db1eb70fb9fbf7e4b86a7a39b9e8677cc06

See more details on using hashes here.

Release history Release notifications | RSS feed

8.0.2

2 files

This release

7.0.2 This release

2 files

7.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page