diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index 0e2791a9fa2..2178341a3bf 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -491,6 +491,8 @@ class AccountJournal(models.Model):
if ('company_id' in vals and journal.company_id.id != vals['company_id']):
if self.env['account.move'].search([('journal_id', 'in', self.ids)], limit=1):
raise UserError(_('This journal already contains items, therefore you cannot modify its company.'))
+ if self.bank_account_id:
+ self.bank_account_id.company_id = vals['company_id']
if ('code' in vals and journal.code != vals['code']):
if self.env['account.move'].search([('journal_id', 'in', self.ids)], limit=1):
raise UserError(_('This journal already contains items, therefore you cannot modify its short name.'))
@@ -504,6 +506,8 @@ class AccountJournal(models.Model):
self.default_debit_account_id.currency_id = vals['currency_id']
if not 'default_credit_account_id' in vals and self.default_credit_account_id:
self.default_credit_account_id.currency_id = vals['currency_id']
+ if self.bank_account_id:
+ self.bank_account_id.currency_id = vals['currency_id']
if 'bank_account_id' in vals and not vals.get('bank_account_id'):
raise UserError(_('You cannot empty the bank account once set.'))
result = super(AccountJournal, self).write(vals)
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
index 671d3b6a60f..c3a37ebf979 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -339,7 +339,7 @@ class AccountBankStatement(models.Model):
def link_bank_to_partner(self):
for statement in self:
for st_line in statement.line_ids:
- if st_line.bank_account_id and st_line.partner_id and st_line.bank_account_id.partner_id != st_line.partner_id:
+ if st_line.bank_account_id and st_line.partner_id and not st_line.bank_account_id.partner_id:
st_line.bank_account_id.partner_id = st_line.partner_id
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 6ab2d6476ef..92ea5f493f6 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -106,7 +106,7 @@ class AccountMove(models.Model):
default=lambda self: self.env.user.company_id)
matched_percentage = fields.Float('Percentage Matched', compute='_compute_matched_percentage', digits=0, store=True, readonly=True, help="Technical field used in cash basis method")
# Dummy Account field to search on account.move by account_id
- dummy_account_id = fields.Many2one('account.account', related='line_ids.account_id', string='Account', store=False)
+ dummy_account_id = fields.Many2one('account.account', related='line_ids.account_id', string='Account', store=False, readonly=True)
tax_cash_basis_rec_id = fields.Many2one(
'account.partial.reconcile',
string='Tax Cash Basis Entry of',
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index 40f6e5a03ac..870af267239 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/l10n_fr/data/account_chart_template_data.xml b/addons/l10n_fr/data/account_chart_template_data.xml
index db836b0fd3b..aac0137d150 100644
--- a/addons/l10n_fr/data/account_chart_template_data.xml
+++ b/addons/l10n_fr/data/account_chart_template_data.xml
@@ -2836,98 +2836,98 @@
Valeurs mobilières de placement - Parts dans entreprises liées
501
-
+
Valeurs mobilières de placement - Actions propres
502
-
+
Valeurs mobilières de placement - Titres cotés
5031
-
+
Valeurs mobilières de placement - Titres non cotés
5035
-
+
Valeurs mobilières de placement - Autres titres conférant un droit de propriété
504
-
+
Obligations et bons émis par la société et rachetés par elle
505
-
+
Obligations cotés
5061
-
+
Obligations non cotés
5065
-
+
Bons du Trésor et bons de caisse à court terme
507
-
+
Autres valeurs mobilières de placement
5081
-
+
Bons de souscription
5082
-
+
Intérêts courus sur obligations, bons et valeurs assimilées
5088
-
+
Versements restant à effectuer sur valeurs mobilières de placement non libérées
509
-
+
Coupons échus à l'encaissement
5111
-
+
@@ -2935,7 +2935,7 @@
Chèques à encaisser
5112
-
+
@@ -2943,7 +2943,7 @@
Effets à l'encaissement
5113
-
+
@@ -2951,7 +2951,7 @@
Effets à l'escompte
5114
-
+
@@ -2980,56 +2980,56 @@
Sociétés de bourse
516
-
+
Autres organismes financiers
517
-
+
Intérêts courus à payer
5181
-
+
Intérêts courus à recevoir
5188
-
+
Concours bancaires courants - Crédit de mobilisation de créances commerciales (CMCC)
5191
-
+
Concours bancaires courants - Mobilisation de créances nées à l'étranger
5193
-
+
Concours bancaires courants - Intérêts courus sur concours bancaires courants
5198
-
+
Instruments de trésorerie
52
-
+
@@ -3064,35 +3064,35 @@
Régies d'avances et accréditifs
54
-
+
Provisions pour dépréciation des actions
5903
-
+
Provisions pour dépréciation des autres titres conférant un droit de propriété
5904
-
+
Provisions pour dépréciation des obligations
5906
-
+
Provisions pour dépréciation des autres valeurs mobilières de placement et créances assimilées (provisions)
5908
-
+
diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index e24a3193f97..5767f3f7eb7 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -56,7 +56,7 @@ class Channel(models.Model):
('channel', 'Channel')],
'Channel Type', default='channel')
description = fields.Text('Description')
- uuid = fields.Char('UUID', size=50, index=True, default=lambda self: '%s' % uuid.uuid4())
+ uuid = fields.Char('UUID', size=50, index=True, default=lambda self: '%s' % uuid.uuid4(), copy=False)
email_send = fields.Boolean('Send messages by email', default=False)
# multi users channel
channel_last_seen_partner_ids = fields.One2many('mail.channel.partner', 'channel_id', string='Last Seen')
diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py
index 91c5bc3749f..89fcd975c60 100644
--- a/addons/purchase/models/purchase.py
+++ b/addons/purchase/models/purchase.py
@@ -327,7 +327,7 @@ class PurchaseOrder(models.Model):
@api.multi
def button_approve(self, force=False):
- self.write({'state': 'purchase'})
+ self.write({'state': 'purchase', 'date_approve': fields.Date.context_today(self)})
self._create_picking()
if self.company_id.po_lock == 'lock':
self.write({'state': 'done'})
diff --git a/addons/sale/wizard/mail_compose_message.py b/addons/sale/wizard/mail_compose_message.py
index 73d81116d50..9ec46b48308 100644
--- a/addons/sale/wizard/mail_compose_message.py
+++ b/addons/sale/wizard/mail_compose_message.py
@@ -12,6 +12,6 @@ class MailComposeMessage(models.TransientModel):
if self._context.get('default_model') == 'sale.order' and self._context.get('default_res_id') and self._context.get('mark_so_as_sent'):
order = self.env['sale.order'].browse([self._context['default_res_id']])
if order.state == 'draft':
- order.state = 'sent'
+ order.with_context(tracking_disable=True).state = 'sent'
self = self.with_context(mail_post_autofollow=True)
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
diff --git a/addons/stock/__init__.py b/addons/stock/__init__.py
index 7039d459cb8..66322ee14f3 100644
--- a/addons/stock/__init__.py
+++ b/addons/stock/__init__.py
@@ -4,4 +4,16 @@
from . import controllers
from . import models
from . import report
-from . import wizard
\ No newline at end of file
+from . import wizard
+
+
+from odoo import api, SUPERUSER_ID
+
+
+# TODO: Apply proper fix & remove in master
+def pre_init_hook(cr):
+ env = api.Environment(cr, SUPERUSER_ID, {})
+ env['ir.model.data'].search([
+ ('model', 'like', '%stock%'),
+ ('module', '=', 'stock')
+ ]).unlink()
diff --git a/addons/stock/__manifest__.py b/addons/stock/__manifest__.py
index 1c5fcd5580a..acea1805f94 100644
--- a/addons/stock/__manifest__.py
+++ b/addons/stock/__manifest__.py
@@ -84,4 +84,5 @@
'installable': True,
'application': True,
'auto_install': False,
+ 'pre_init_hook': 'pre_init_hook',
}
diff --git a/addons/website_form/static/src/js/website_form.js b/addons/website_form/static/src/js/website_form.js
index 47ba66c244b..5318a84067d 100644
--- a/addons/website_form/static/src/js/website_form.js
+++ b/addons/website_form/static/src/js/website_form.js
@@ -58,7 +58,7 @@ odoo.define('website_form.animation', function (require) {
send: function (e) {
e.preventDefault(); // Prevent the default submit behavior
- this.$target.find('.o_website_form_send').off(); // Prevent users from crazy clicking
+ this.$target.find('.o_website_form_send').off().addClass('disabled'); // Prevent users from crazy clicking
var self = this;
@@ -231,7 +231,7 @@ odoo.define('website_form.animation', function (require) {
update_status: function (status) {
var self = this;
if (status !== 'success') { // Restore send button behavior if result is an error
- this.$target.find('.o_website_form_send').on('click',function (e) {self.send(e);});
+ this.$target.find('.o_website_form_send').on('click',function (e) {self.send(e);}).removeClass('disabled');
}
var $result = this.$('#o_website_form_result');
this.templates_loaded.done(function () {
diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml
index 2fe73d24432..b77405298fa 100644
--- a/addons/website_sale/views/templates.xml
+++ b/addons/website_sale/views/templates.xml
@@ -170,7 +170,7 @@
Shop