diff options
| author | Raphael Collet <rco@openerp.com> | 2016-08-12 09:36:25 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2016-08-16 09:55:46 +0200 |
| commit | ffdafd3f8a6a18f2af9d5aa7f2446c299cb71967 (patch) | |
| tree | de82f81db7be5b64f9f4226aea31048f2089bf74 /addons | |
| parent | 856f2e87e645db697a67fc85caae07bf0fe11d3f (diff) | |
[REM] most uses of `_model` (useless in most cases)
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/models/chart_template.py | 2 | ||||
| -rw-r--r-- | addons/mail/models/mail_thread.py | 2 | ||||
| -rw-r--r-- | addons/mail/views/mail_templates.xml | 2 | ||||
| -rw-r--r-- | addons/marketing_campaign/models/marketing_campaign.py | 2 | ||||
| -rw-r--r-- | addons/resource/tests/test_resource.py | 2 | ||||
| -rw-r--r-- | addons/web_editor/models/ir_qweb.py | 2 | ||||
| -rw-r--r-- | addons/website_mail/controllers/main.py | 2 | ||||
| -rw-r--r-- | addons/website_mail/views/website_mail_templates.xml | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index c74fdd7f702..effca2ce1a4 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -343,7 +343,7 @@ class AccountChartTemplate(models.Model): # also create an entry in ir_model_data to have an xmlid for the newly created record # xmlid is the concatenation of company_id and template_xml_id ir_model_data = self.env['ir.model.data'] - template_xmlid = ir_model_data.search([('model', '=', str(template._model)), ('res_id', '=', template.id)]) + template_xmlid = ir_model_data.search([('model', '=', template._name), ('res_id', '=', template.id)]) new_xml_id = str(company.id)+'_'+template_xmlid.name return ir_model_data._update(model, template_xmlid.module, vals, xml_id=new_xml_id, store=True, noupdate=True, mode='init', res_id=False) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 3e07a89594b..e88024b17fc 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -763,7 +763,7 @@ class MailThread(models.AbstractModel): self.ensure_one() database_uuid = self.env['ir.config_parameter'].get_param('database.uuid') return {'headers': repr({ - 'X-Odoo-Objects': "%s-%s" % (self._model, self.id), + 'X-Odoo-Objects': "%s-%s" % (self._name, self.id), 'X-Odoo-db-uuid': database_uuid })} diff --git a/addons/mail/views/mail_templates.xml b/addons/mail/views/mail_templates.xml index a3aace7b85e..192486b6eaa 100644 --- a/addons/mail/views/mail_templates.xml +++ b/addons/mail/views/mail_templates.xml @@ -33,7 +33,7 @@ <template id="message_origin_link"> <p>This <t t-esc="self._description.lower()"/> has been <span t-if="edit">modified</span><span t-if="not edit">created</span> from: <t t-foreach="origin" t-as="o"> - <a href="#" t-att-data-oe-model="o._model" t-att-data-oe-id="o.id"> <t t-esc="o.name"/></a><span t-if="origin.ids[-1:] != o.ids">, </span> + <a href="#" t-att-data-oe-model="o._name" t-att-data-oe-id="o.id"> <t t-esc="o.name"/></a><span t-if="origin.ids[-1:] != o.ids">, </span> </t> </p> </template> diff --git a/addons/marketing_campaign/models/marketing_campaign.py b/addons/marketing_campaign/models/marketing_campaign.py index df30bf73a94..a7b68e72bf3 100644 --- a/addons/marketing_campaign/models/marketing_campaign.py +++ b/addons/marketing_campaign/models/marketing_campaign.py @@ -338,7 +338,7 @@ class MarketingCampaignActivity(models.Model): method = '_process_wi_%s' % (self.action_type,) action = getattr(self, method, None) if not action: - raise NotImplementedError('Method %r is not implemented on %r object.' % (method, self._model)) + raise NotImplementedError('Method %r is not implemented on %r object.' % (method, self._name)) return action(workitem) diff --git a/addons/resource/tests/test_resource.py b/addons/resource/tests/test_resource.py index 2a4f9ee109f..eff3fdd6a49 100644 --- a/addons/resource/tests/test_resource.py +++ b/addons/resource/tests/test_resource.py @@ -70,7 +70,7 @@ class TestResource(TestResourceCommon): # Test: schedule hours on intervals, backwards cleaned_intervals.reverse() - result = self.ResourceCalendar._model.interval_schedule_hours(cleaned_intervals, 5.5, remove_at_end=False) + result = self.ResourceCalendar.interval_schedule_hours(cleaned_intervals, 5.5, remove_at_end=False) self.assertEqual(len(result), 2, 'resource_calendar: wrong hours scheduling in interval') # First interval: 03, 8-10 untouches self.assertEqual(result[0][0], Datetime.from_string('2013-02-04 17:00:00'), 'resource_calendar: wrong leave removal from interval') diff --git a/addons/web_editor/models/ir_qweb.py b/addons/web_editor/models/ir_qweb.py index ca16f9e86a9..a9bb7f7fd21 100644 --- a/addons/web_editor/models/ir_qweb.py +++ b/addons/web_editor/models/ir_qweb.py @@ -82,7 +82,7 @@ class Field(models.AbstractModel): attrs['placeholder'] = placeholder if options['translate'] and field.type in ('char', 'text'): - name = "%s,%s" % (record._model._name, field_name) + name = "%s,%s" % (record._name, field_name) domain = [('name', '=', name), ('res_id', '=', record.id), ('type', '=', 'model'), ('lang', '=', options.get('lang'))] translation = record.env['ir.translation'].search(domain, limit=1) attrs['data-oe-translation-state'] = translation and translation.state or 'to_translate' diff --git a/addons/website_mail/controllers/main.py b/addons/website_mail/controllers/main.py index ca7678a458e..c966b2bede7 100644 --- a/addons/website_mail/controllers/main.py +++ b/addons/website_mail/controllers/main.py @@ -16,7 +16,7 @@ def object_shasign(record=False, res_model='', res_id=None, **kw): shasign = False timestamp = int(time()) if record: - shasign = sha1('%s%s%s%s' % (record._model, record.id, secret, timestamp)).hexdigest() + shasign = sha1('%s%s%s%s' % (record._name, record.id, secret, timestamp)).hexdigest() elif res_model and res_id: shasign = sha1('%s%s%s%s' % (res_model, res_id, secret, timestamp)).hexdigest() return (shasign, timestamp) diff --git a/addons/website_mail/views/website_mail_templates.xml b/addons/website_mail/views/website_mail_templates.xml index b65a19b3271..cf250cc18b2 100644 --- a/addons/website_mail/views/website_mail_templates.xml +++ b/addons/website_mail/views/website_mail_templates.xml @@ -48,7 +48,7 @@ <img class="img pull-left img-circle" t-attf-src="/web/image/res.partner/#{user_id.partner_id.id}/image_small/50x50" style="width: 50px; margin-right: 10px;"/> <div class="pull-left mb32" style="width: 75%%"> <textarea rows="4" name="message" class="form-control" placeholder="Write a message..."></textarea> - <input type='hidden' name="res_model" t-att-value="object._model"/> + <input type='hidden' name="res_model" t-att-value="object._name"/> <input type='hidden' name="res_id" t-att-value="object.id"/> <input type='hidden' name="token" t-att-value="token" t-if="token"/> <input type='hidden' name="sha_in" t-att-value="sha_in" t-if="sha_in"/> |
