From 186cfb5ebd35d572d0f635cd7975de7cff0d1055 Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Thu, 28 Nov 2019 15:18:33 +0000 Subject: [REF] mail: make alias mixin multi-enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-Authored-By: Thibault Delavallée --- doc/reference/mixins.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/reference') 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 # -- cgit v1.2.3