summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-08 17:29:03 +0200
committerChristophe Simonis <chs@odoo.com>2018-10-08 17:29:03 +0200
commit0ef5cedebb3096b4cb0d05e49d4dab84e09c3f56 (patch)
treeaa47e021467b2fbffb5b29542182bee9ae1b4841 /addons
parent6cb75dc3d696a3d47072e5d81291307ca4554a3b (diff)
parent637e4c68fc052d93ffec88cb4ab618e32a772fd0 (diff)
[MERGE] forward port branch saas-14 up to 637e4c68fc0
Diffstat (limited to 'addons')
-rw-r--r--addons/mail/models/mail_tracking_value.py4
-rw-r--r--addons/mail/views/mail_templates.xml2
-rw-r--r--addons/stock_account/models/stock.py7
3 files changed, 8 insertions, 5 deletions
diff --git a/addons/mail/models/mail_tracking_value.py b/addons/mail/models/mail_tracking_value.py
index 5fbe63d6a14..24d3aff9207 100644
--- a/addons/mail/models/mail_tracking_value.py
+++ b/addons/mail/models/mail_tracking_value.py
@@ -60,8 +60,8 @@ class MailTracking(models.Model):
values.update({
'old_value_integer': initial_value and initial_value.id or 0,
'new_value_integer': new_value and new_value.id or 0,
- 'old_value_char': initial_value and initial_value.name_get()[0][1] or '',
- 'new_value_char': new_value and new_value.name_get()[0][1] or ''
+ 'old_value_char': initial_value and initial_value.sudo().name_get()[0][1] or '',
+ 'new_value_char': new_value and new_value.sudo().name_get()[0][1] or ''
})
else:
tracked = False
diff --git a/addons/mail/views/mail_templates.xml b/addons/mail/views/mail_templates.xml
index bfa78eb1213..0a0248da40f 100644
--- a/addons/mail/views/mail_templates.xml
+++ b/addons/mail/views/mail_templates.xml
@@ -42,7 +42,7 @@
</template>
<template id="message_user_assigned">
- <p>Dear <t t-esc="object.user_id.name"/>,</p>
+ <p>Dear <t t-esc="object.user_id.sudo().name"/>,</p>
<p>You have been assigned to the <t t-esc="object._description.lower()"/> <t t-esc="object.name_get()[0][1]"/>.</p>
<p>
<a t-att-href="'/mail/view?model=%s&amp;res_id=%s' % (object._name, object.id)"
diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py
index e91521e5037..0ba1f76102a 100644
--- a/addons/stock_account/models/stock.py
+++ b/addons/stock_account/models/stock.py
@@ -118,10 +118,13 @@ class StockQuant(models.Model):
else:
self.with_context(force_company=company_from.id)._create_account_move_line(move, acc_valuation, acc_dest, journal_id)
- if move.company_id.anglo_saxon_accounting and move.location_id.usage == 'supplier' and move.location_dest_id.usage == 'customer':
+ if move.company_id.anglo_saxon_accounting:
# Creates an account entry from stock_input to stock_output on a dropship move. https://github.com/odoo/odoo/issues/12687
journal_id, acc_src, acc_dest, acc_valuation = move._get_accounting_data_for_valuation()
- self.with_context(force_company=move.company_id.id)._create_account_move_line(move, acc_src, acc_dest, journal_id)
+ if move.location_id.usage == 'supplier' and move.location_dest_id.usage == 'customer':
+ self.with_context(force_company=move.company_id.id)._create_account_move_line(move, acc_src, acc_dest, journal_id)
+ if move.location_id.usage == 'customer' and move.location_dest_id.usage == 'supplier':
+ self.with_context(force_company=move.company_id.id)._create_account_move_line(move, acc_dest, acc_src, journal_id)
def _create_account_move_line(self, move, credit_account_id, debit_account_id, journal_id):
# group quants by cost