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 8.0

Changes

8.0.2 - 03.08.2026

  • migrate to 8.0

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-8.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-8.0.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mds_irrulecontext-8.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-8.0.2.tar.gz
Algorithm Hash digest
SHA256 b3ede99012da406ac11ea460f04161b21ff88d9b0960f368b0cd6551a8f71a73
MD5 af4c9954ca459100c5f61a15b1c00d49
BLAKE2b-256 1b58f7e409619706b392233c7ecc956f0c8c1f5117ccce4bb9a2ab181755bc85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mds_irrulecontext-8.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9345aa8e22e21b6a52f50cb394dc099a0e148342baa61de2565ffcc27e9da634
MD5 fa1cc5aa17aefb397bc71768f829e532
BLAKE2b-256 848d12a1811f330a4645fc8b8d039670a14e8f32cbb786ac7ed7d22b2da034bd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

8.0.2 This release

2 files

7.0.2

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