diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index 709e7a9bc97..43f00287586 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 b602e2832f3..ae86ca440d3 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 86d3d244ea6..6515b82eac0 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 a9bc0ae22f6..a5a863c4aac 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 65756125982..055c90527f6 100644
--- a/addons/purchase/models/purchase.py
+++ b/addons/purchase/models/purchase.py
@@ -317,7 +317,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 7a8b413a04b..2f91db94c9b 100644
--- a/addons/website_form/static/src/js/website_form.js
+++ b/addons/website_form/static/src/js/website_form.js
@@ -47,7 +47,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;
@@ -216,7 +216,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_delivery/views/website_sale_delivery_templates.xml b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
index 57b3fa158fc..39fac0ad90f 100644
--- a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
+++ b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml
@@ -36,7 +36,7 @@
diff --git a/addons/website_slides/static/src/js/slides_embed.js b/addons/website_slides/static/src/js/slides_embed.js
index 4e7d3e71652..d3d1321e6c8 100644
--- a/addons/website_slides/static/src/js/slides_embed.js
+++ b/addons/website_slides/static/src/js/slides_embed.js
@@ -50,12 +50,12 @@ $(document).ready(function () {
},
// page switching
render_page: function (page_number) {
- this.pdf_viewer.renderPage(page_number).then(this.on_rendered_page);
+ this.pdf_viewer.renderPage(page_number).then(this.on_rendered_page.bind(this));
},
change_page: function () {
var page_asked = parseInt(this.$('#page_number').val(), 10);
if(1 <= page_asked && page_asked <= this.pdf_viewer.pdf_page_total){
- this.pdf_viewer.changePage(page_asked).then(this.on_rendered_page);
+ this.pdf_viewer.changePage(page_asked).then(this.on_rendered_page.bind(this));
}else{
// if page number out of range, reset the page_counter to the actual page
this.$('#page_number').val(this.pdf_viewer.pdf_page_current);
diff --git a/doc/cla/corporate/camptocamp.md b/doc/cla/corporate/camptocamp.md
index c934c831a83..777bb974dc5 100644
--- a/doc/cla/corporate/camptocamp.md
+++ b/doc/cla/corporate/camptocamp.md
@@ -32,3 +32,4 @@ Denis Leemann denis.leemann@camptocamp.com https://github.com/leemannd
Akim Juillerat akim.juillerat@camptocamp.com https://github.com/grindtildeath
Damien Crier damien.crier@camptocamp.com https://github.com/damdam-s
Simone Orsi simahawk@gmail.com https://github.com/simahawk
+Patrick Tombez patrick.tombez@camptocamp.com https://github.com/p-tombez
diff --git a/doc/cla/individual/apesquero.md b/doc/cla/individual/apesquero.md
new file mode 100644
index 00000000000..8c04cee5dc7
--- /dev/null
+++ b/doc/cla/individual/apesquero.md
@@ -0,0 +1,11 @@
+Spain, 2018-02-26
+
+I hereby agree to the terms of the Odoo Individual Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Amaro Pesquero apesquero@gmail.com https://github.com/apesquero
diff --git a/doc/reference/views.rst b/doc/reference/views.rst
index 35c4a13dee6..c2fee0f508d 100644
--- a/doc/reference/views.rst
+++ b/doc/reference/views.rst
@@ -228,8 +228,7 @@ Possible children elements of the list view are:
context of the current row's record, if ``True`` the corresponding
attribute is set on the cell.
- Possible attributes are ``invisible`` (hides the button) and
- ``readonly`` (disables the button but still shows it)
+ Possible attribute is ``invisible`` (hides the button).
``states``
shorthand for ``invisible`` ``attrs``: a list of states, comma separated,
requires that the model has a ``state`` field and that it is
diff --git a/odoo/addons/base/base_data.xml b/odoo/addons/base/base_data.xml
index 322cd3ae324..f2f6ae363c0 100644
--- a/odoo/addons/base/base_data.xml
+++ b/odoo/addons/base/base_data.xml
@@ -60,7 +60,7 @@ Administrator]]>
-
+
localhost
localhost
diff --git a/odoo/addons/test_pylint/tests/test_pylint.py b/odoo/addons/test_pylint/tests/test_pylint.py
index 22573c699a2..fd31bafe161 100644
--- a/odoo/addons/test_pylint/tests/test_pylint.py
+++ b/odoo/addons/test_pylint/tests/test_pylint.py
@@ -27,8 +27,12 @@ class TestPyLint(TransactionCase):
'W0101', # unreachable code
'mixed-indentation',
+ 'deprecated-module',
]
+ BAD_MODULES = [
+ ] + list(tools.SUPPORTED_DEBUGGER)
+
def _skip_test(self, reason):
_logger.warn(reason)
self.skipTest(reason)
@@ -50,6 +54,7 @@ class TestPyLint(TransactionCase):
'--enable=%s' % ','.join(self.ENABLED_CODES),
'--reports=n',
"--msg-template='{msg} ({msg_id}) at {path}:{line}'",
+ '--deprecated-modules=%s' % ','.join(self.BAD_MODULES),
]
try:
diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py
index a597a8a44fa..3889faa2c80 100644
--- a/odoo/tools/yaml_import.py
+++ b/odoo/tools/yaml_import.py
@@ -461,7 +461,7 @@ class YamlInterpreter(object):
ctx['field_parent'] = fg[field_name]['relation_field']
if default and field_elem.get('context'):
ctx.update(safe_eval(field_elem.get('context'),
- globals_dict={'parent': dotdict(parent)},
+ globals_dict={'parent': dotdict(parent), 'context': ctx},
locals_dict=record_dict))
field_value = self._eval_field(model, field_name, fields[field_name], form_view, parent=record_dict, default=default, context=ctx)