summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-06-07 11:09:29 +0200
committerChristophe Simonis <chs@odoo.com>2019-06-07 11:09:29 +0200
commit6c6e652673c8fb830e4de81f9683eb9e8609fdf8 (patch)
tree61a7b63ef4599ca1ae7e17981250a167e8fb9a9c /addons
parentcad0be27e71e8fcd1424715dd82103bd497390d2 (diff)
parent757846c5912efa1edcf29dd6283d79341d0413ed (diff)
[MERGE] forward port branch saas-14 up to 757846c5912
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py5
-rw-r--r--addons/account_asset/models/account_asset.py4
-rw-r--r--addons/l10n_be_intrastat_2019/__manifest__.py1
-rw-r--r--addons/l10n_be_intrastat_2019/views/report_invoice.xml33
-rw-r--r--addons/payment_adyen/models/payment.py2
-rw-r--r--addons/web_editor/static/src/js/widgets.js1
6 files changed, 41 insertions, 5 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 69eaa567490..6ad1b0c0fe0 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -227,6 +227,7 @@ class AccountMove(models.Model):
@api.multi
def _reverse_move(self, date=None, journal_id=None):
self.ensure_one()
+ date = date or fields.Date.today()
reversed_move = self.copy(default={
'date': date,
'journal_id': journal_id.id if journal_id else self.journal_id.id,
@@ -437,8 +438,8 @@ class AccountMoveLine(models.Model):
help="Technical field used to mark a tax line as exigible in the vat report or not (only exigible journal items are displayed). By default all new journal items are directly exigible, but with the feature cash_basis on taxes, some will become exigible only when the payment is recorded.")
_sql_constraints = [
- ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in accounting entry !'),
- ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in accounting entry !'),
+ ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in accounting entry! Credit or debit should be zero.'),
+ ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in accounting entry! Credit and debit should be positive.'),
]
@api.model
diff --git a/addons/account_asset/models/account_asset.py b/addons/account_asset/models/account_asset.py
index 2dd11c42fa6..b58122cddc0 100644
--- a/addons/account_asset/models/account_asset.py
+++ b/addons/account_asset/models/account_asset.py
@@ -481,9 +481,9 @@ class AccountAssetDepreciationLine(models.Model):
def create_move(self, post_move=True):
created_moves = self.env['account.move']
prec = self.env['decimal.precision'].precision_get('Account')
+ if self.mapped('move_id'):
+ raise UserError(_('This depreciation is already linked to a journal entry! Please post or delete it.'))
for line in self:
- if line.move_id:
- raise UserError(_('This depreciation is already linked to a journal entry! Please post or delete it.'))
category_id = line.asset_id.category_id
depreciation_date = self.env.context.get('depreciation_date') or line.depreciation_date or fields.Date.context_today(self)
company_currency = line.asset_id.company_id.currency_id
diff --git a/addons/l10n_be_intrastat_2019/__manifest__.py b/addons/l10n_be_intrastat_2019/__manifest__.py
index b3de01cd46b..48554dc064b 100644
--- a/addons/l10n_be_intrastat_2019/__manifest__.py
+++ b/addons/l10n_be_intrastat_2019/__manifest__.py
@@ -10,6 +10,7 @@ Adds the possibility to specify the origin country of goods and the partner VAT
'depends': ['l10n_be_intrastat'],
'data': [
'views/account_invoice_line_view.xml',
+ 'views/report_invoice.xml',
],
'auto_install': True,
}
diff --git a/addons/l10n_be_intrastat_2019/views/report_invoice.xml b/addons/l10n_be_intrastat_2019/views/report_invoice.xml
new file mode 100644
index 00000000000..c693021d0dc
--- /dev/null
+++ b/addons/l10n_be_intrastat_2019/views/report_invoice.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+<template id="report_invoice_document_intrastat_2019" inherit_id="account.report_invoice_document">
+ <xpath expr="//th[@class='hidden']" position="after">
+ <th class="text-right">Origin Country</th>
+ </xpath>
+ <xpath expr="//td[@class='hidden']" position="after">
+ <td class="text-right">
+ <span t-field="l.intrastat_product_origin_country_id"/>
+ </td>
+ </xpath>
+</template>
+<template id="report_intrastatinvoice_document_2019" inherit_id="report_intrastat.report_intrastatinvoice_document">
+ <xpath expr="//th[4]" position="after">
+ <th class="text-right">Origin Country</th>
+ </xpath>
+ <xpath expr="//td[4]" position="after">
+ <td class="text-right">
+ <span t-field="l.intrastat_product_origin_country_id"/>
+ </td>
+ </xpath>
+</template>
+<template id="report_invoice_layouted_intrastat_2019" inherit_id="sale.report_invoice_layouted">
+ <xpath expr="//t[@groups='sale.group_sale_layout']//th[1]" position="after">
+ <th class="text-right">Origin Country</th>
+ </xpath>
+ <xpath expr="//t[@groups='sale.group_sale_layout']//t[@t-as='l']//td[1]" position="after">
+ <td class="text-right">
+ <span t-field="l.intrastat_product_origin_country_id"/>
+ </td>
+ </xpath>
+</template>
+</odoo>
diff --git a/addons/payment_adyen/models/payment.py b/addons/payment_adyen/models/payment.py
index b54adc58a9c..216ac86e575 100644
--- a/addons/payment_adyen/models/payment.py
+++ b/addons/payment_adyen/models/payment.py
@@ -128,7 +128,7 @@ class AcquirerAdyen(models.Model):
'sessionValidity': tmp_date.isoformat('T')[:19] + "Z",
'resURL': '%s' % urlparse.urljoin(base_url, AdyenController._return_url),
'merchantReturnData': json.dumps({'return_url': '%s' % values.pop('return_url')}) if values.get('return_url', '') else False,
- 'shopperEmail': values.get('partner_email', ''),
+ 'shopperEmail': values.get('partner_email') or values.get('billing_partner_email') or '',
})
values['merchantSig'] = self._adyen_generate_merchant_sig_sha256('in', values)
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index a9f7538a036..8244dcdfb25 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -1006,6 +1006,7 @@ var LinkDialog = Dialog.extend({
}
this.data.range = range.create(sc, so, ec, eo);
+ $(editable).data("range", this.data.range);
this.data.range.select();
} else {
nodes = dom.ancestor(sc, dom.isAnchor).childNodes;