diff options
| author | ryv-odoo <ryv@odoo.com> | 2019-11-28 15:18:33 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-04-17 06:52:09 +0000 |
| commit | 186cfb5ebd35d572d0f635cd7975de7cff0d1055 (patch) | |
| tree | ee135e1a5b8b68bc74b44149440bb776956a54ee /doc/reference | |
| parent | 7cfd364db54e88970ef51c798df3bd4df44222b3 (diff) | |
[REF] mail: make alias mixin multi-enabled
Purpose of this commit is to allow multi-create in alias mixin by correctly
creating / updating aliases in batch.
Task ID 1919277
Community PR odoo/odoo#41160
Enterprise PR odoo/enterprise#6983
Upgrade PR odoo/upgrade#872
Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Diffstat (limited to 'doc/reference')
| -rw-r--r-- | doc/reference/mixins.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/reference/mixins.rst b/doc/reference/mixins.rst index c80ffc52c79..d290e418652 100644 --- a/doc/reference/mixins.rst +++ b/doc/reference/mixins.rst @@ -556,7 +556,7 @@ specific overrides to work correctly. These overrides will specify the values of the created alias, like the kind of record it must create and possibly some default values these records may have depending on the parent object: -.. method:: get_alias_model_name(vals) +.. method:: _get_alias_model_name(vals) Return the model name for the alias. Incoming emails that are not replies to existing records will cause the creation of a new record @@ -568,7 +568,7 @@ some default values these records may have depending on the parent object: :return: model name :rtype: str -.. method:: get_alias_values() +.. method:: _get_alias_values() Return values to create an alias, or to write on the alias after its creation. While not completely mandatory, it is usually required to make @@ -579,7 +579,7 @@ some default values these records may have depending on the parent object: :return: dictionnary of values that will be written to the new alias :rtype: dict -The ``get_alias_values()`` override is particularly interesting as it allows you +The ``_get_alias_values()`` override is particularly interesting as it allows you to modify the behaviour of your aliases easily. Among the fields that can be set on the alias, the following are of particular interest: @@ -632,13 +632,13 @@ you to make your alias easily configurable from the record's form view. alias_id = fields.Many2one('mail.alias', string='Alias', ondelete="restrict", required=True) - def get_alias_model_name(self, vals): + def _get_alias_model_name(self, vals): """ Specify the model that will get created when the alias receives a message """ return 'business.expense' - def get_alias_values(self): + def _get_alias_values(self): """ Specify some default values that will be set in the alias at its creation """ - values = super(BusinessTrip, self).get_alias_values() + values = super(BusinessTrip, self)._get_alias_values() # alias_defaults holds a dictionnary that will be written # to all records created by this alias # |
