diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index be9a5828f01..797ac91bad9 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -306,6 +306,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.'))
@@ -319,6 +321,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_acc_number' in vals and not vals.get('bank_acc_number') and journal.bank_account_id:
raise UserError(_('You cannot empty the account number once set.\nIf you would like to delete the account number, you can do it from the Bank Accounts list.'))
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 db1909c71c1..2e8cc115307 100644
--- a/addons/account/models/account_bank_statement.py
+++ b/addons/account/models/account_bank_statement.py
@@ -338,7 +338,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 c13cac6c352..8021a51941f 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -100,7 +100,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 c55ee9503e9..a6765f9fc05 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 6e2120f6c14..7d14cd2d9eb 100644
--- a/addons/l10n_fr/data/account_chart_template_data.xml
+++ b/addons/l10n_fr/data/account_chart_template_data.xml
@@ -2814,98 +2814,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
-
+
@@ -2913,7 +2913,7 @@
Chèques à encaisser
5112
-
+
@@ -2921,7 +2921,7 @@
Effets à l'encaissement
5113
-
+
@@ -2929,7 +2929,7 @@
Effets à l'escompte
5114
-
+
@@ -2958,56 +2958,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
-
+
@@ -3042,35 +3042,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/purchase/models/purchase.py b/addons/purchase/models/purchase.py
index 36adc53f5bd..7886a7a8e69 100644
--- a/addons/purchase/models/purchase.py
+++ b/addons/purchase/models/purchase.py
@@ -319,7 +319,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 ddac13e1a0e..bb5953c4834 100644
--- a/addons/stock/__init__.py
+++ b/addons/stock/__init__.py
@@ -4,4 +4,16 @@
import controllers
import models
import report
-import wizard
\ No newline at end of file
+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 9729e82be32..8f9a088fbf9 100644
--- a/addons/stock/__manifest__.py
+++ b/addons/stock/__manifest__.py
@@ -101,4 +101,5 @@ Dashboard / Reports for Inventory Management will include:
'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 431250907c3..716c49ed685 100644
--- a/addons/website_form/static/src/js/website_form.js
+++ b/addons/website_form/static/src/js/website_form.js
@@ -56,7 +56,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;
@@ -225,7 +225,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 02bb081c3a5..2a54de0395f 100644
--- a/addons/website_sale/views/templates.xml
+++ b/addons/website_sale/views/templates.xml
@@ -166,7 +166,7 @@
Shop