diff --git a/addons/account/__init__.py b/addons/account/__init__.py
index dc3a8f3e476..35c6e44d75c 100644
--- a/addons/account/__init__.py
+++ b/addons/account/__init__.py
@@ -45,6 +45,8 @@ def _auto_install_l10n(cr, registry):
'PL', 'PT', 'RO', 'SI', 'TR', 'UK', 'VE', 'VN'
]:
module_list.append('base_vat')
+ if country_code == 'MX':
+ module_list.append('l10n_mx_edi')
# European countries will be using SEPA
europe = env.ref('base.europe', raise_if_not_found=False)
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
index 7f09875044e..7cee63c3122 100644
--- a/addons/account/models/account_payment.py
+++ b/addons/account/models/account_payment.py
@@ -257,11 +257,13 @@ class account_register_payments(models.TransientModel):
'''
amount = self._compute_payment_amount(invoices=invoices) if self.multi else self.amount
payment_type = ('inbound' if amount > 0 else 'outbound') if self.multi else self.payment_type
+ communication = (' '.join([inv.reference or inv.number for inv in invoices])
+ if self.multi else self.communication)
return {
'journal_id': self.journal_id.id,
'payment_method_id': self.payment_method_id.id,
'payment_date': self.payment_date,
- 'communication': self.communication,
+ 'communication': communication, # DO NOT FORWARD PORT TO V12 OR ABOVE
'invoice_ids': [(6, 0, invoices.ids)],
'payment_type': payment_type,
'amount': abs(amount),
diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py
index d0ca0a7c424..50da5d99eaa 100644
--- a/addons/delivery/models/sale_order.py
+++ b/addons/delivery/models/sale_order.py
@@ -99,9 +99,15 @@ class SaleOrder(models.Model):
taxes_ids = self.fiscal_position_id.map_tax(taxes, carrier.product_id, self.partner_id).ids
# Create the sales order line
+ carrier_with_partner_lang = carrier.with_context(lang=self.partner_id.lang)
+ if carrier_with_partner_lang.product_id.description_sale:
+ so_description = '%s: %s' % (carrier_with_partner_lang.name,
+ carrier_with_partner_lang.product_id.description_sale)
+ else:
+ so_description = carrier_with_partner_lang.name
values = {
'order_id': self.id,
- 'name': carrier.with_context(lang=self.partner_id.lang).name,
+ 'name': so_description,
'product_uom_qty': 1,
'product_uom': carrier.product_id.uom_id.id,
'product_id': carrier.product_id.id,
diff --git a/addons/delivery/views/delivery_view.xml b/addons/delivery/views/delivery_view.xml
index f0c867bce0f..e52d5e13e0a 100644
--- a/addons/delivery/views/delivery_view.xml
+++ b/addons/delivery/views/delivery_view.xml
@@ -93,7 +93,7 @@
-
+
diff --git a/addons/l10n_ca/data/account_tax_data.xml b/addons/l10n_ca/data/account_tax_data.xml
index 803e63c0435..174c30ef360 100644
--- a/addons/l10n_ca/data/account_tax_data.xml
+++ b/addons/l10n_ca/data/account_tax_data.xml
@@ -112,7 +112,7 @@
sale
100
group
-
+
diff --git a/addons/l10n_de_skr03/data/account_tax_fiscal_position_data.xml b/addons/l10n_de_skr03/data/account_tax_fiscal_position_data.xml
index 41d065d79c9..4d172b2999c 100644
--- a/addons/l10n_de_skr03/data/account_tax_fiscal_position_data.xml
+++ b/addons/l10n_de_skr03/data/account_tax_fiscal_position_data.xml
@@ -77,7 +77,74 @@
-
+
+ 97
+
+ 19% Umsatzsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 19% USt innerg. Erw. - 0% Vorsteuer
+ percent
+ -19
+
+
+ none
+
+
+
+
+ 97
+
+ 19% Vorsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 19% VSt innerg. Erw. - 0% Vorsteuer
+ percent
+ 19
+ none
+
+
+
+ 20
+
+ Innergem. Erwerb 19%USt/0%VSt
+ innergem. Erwerb 19% - 0% Vorsteuer
+ group
+ 0
+ purchase
+
+
+
+
+ 97
+
+ 7% Umsatzsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 7% USt innerg. Erw. - 0% Vorsteuer
+ percent
+ -7
+
+
+ none
+
+
+
+
+ 97
+
+ 7% Vorsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 7% VSt innerg. Erw. - 0% Vorsteuer
+ percent
+ 7
+ none
+
+
+
+ 20
+
+ Innergem. Erwerb 7%USt/0%VSt
+ innergem. Erwerb 7% - 0% Vorsteuer
+ group
+ 0
+ purchase
+
+
+
99
@@ -163,29 +230,75 @@
20
- 19% Einfuhrumsatzsteuer
+ 19% Einfuhrumsatzsteuer (abzugsf. Vorsteuer)
19% EUSt
percent
19
- purchase
+ none
-
+
+ 98
+
+ 19% Einfuhrumsatzsteuer (zu bezahlender Aufschub)
+ 19% EUSt (zu bezahlender Aufschub)
+ percent
+ -19
+
+
+ none
+
+
+
21
- 7% Einfuhrumsatzsteuer
- 7% EUSt
+ 19% Einfuhrumsatzsteuer (§21 Abs.3 UstG)
+ Einfuhrumsatzsteuer 19%
+ group
+ 0
+ purchase
+
+
+
+
+ 98
+
+ 7% Einfuhrumsatzsteuer (abzugsf. Vorsteuer)
+ 7% EUSt (abzugsf. Vorsteuer)
percent
7
- purchase
+ none
+
+ 98
+
+ 7% Einfuhrumsatzsteuer (zu bezahlender Aufschub)
+ 7% EUSt (zu bezahlender Aufschub)
+ percent
+ -7
+
+
+ none
+
+
+
+ 21
+
+ 7% Einfuhrumsatzsteuer (§21 Abs.3 UstG)
+ Einfuhrumsatzsteuer 7%
+ group
+ 0
+ purchase
+
+
+
22
@@ -816,7 +929,6 @@
-
105
@@ -969,23 +1081,38 @@
-
+
+ 1
+ Geschäftspartner Inland
- Dienstleister Ausland
+
+
+
+
+ 6
+
+ Dienstleister Ausland (Nicht-EU)
+ 5
- Geschäftspartner Ausland
+ Geschäftspartner Ausland (Nicht-EU)
+ 2
Geschäftspartner EU (mit USt-ID)
+
+
+ 3
Dienstleister EU (mit USt-ID)
+
+ 4
Geschäftspartner EU (ohne USt-ID)
@@ -1021,12 +1148,12 @@
-
+
-
+
@@ -1056,7 +1183,7 @@
-
+
@@ -1066,7 +1193,7 @@
-
+
@@ -1138,7 +1265,7 @@
-
+
@@ -1148,7 +1275,7 @@
-
+
@@ -1239,11 +1366,11 @@
-
+
-
+
@@ -1359,11 +1486,11 @@
-
+
-
+
@@ -1379,17 +1506,21 @@
-
+
-
+
+
+
+
+
@@ -1546,12 +1677,16 @@
+
+
+
+
-
+
@@ -1567,7 +1702,7 @@
-
+
@@ -1583,23 +1718,27 @@
-
+
-
+
-
+
+
+
+
+
-
+
-
+
@@ -1619,11 +1758,11 @@
-
+
-
+
@@ -1635,11 +1774,11 @@
-
+
-
+
@@ -1658,6 +1797,10 @@
+
+
+
+
@@ -1674,6 +1817,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1691,11 +1850,11 @@
-
+
-
+
@@ -1706,8 +1865,12 @@
+
+
+
+
-
+
@@ -1715,11 +1878,11 @@
-
+
-
+
@@ -1747,7 +1910,7 @@
-
+
@@ -1759,11 +1922,11 @@
-
+
-
+
@@ -1799,7 +1962,7 @@
-
+
diff --git a/addons/l10n_de_skr03/data/l10n_de_skr03_chart_data.xml b/addons/l10n_de_skr03/data/l10n_de_skr03_chart_data.xml
index 252f1601cbe..de2314461fc 100644
--- a/addons/l10n_de_skr03/data/l10n_de_skr03_chart_data.xml
+++ b/addons/l10n_de_skr03/data/l10n_de_skr03_chart_data.xml
@@ -4109,7 +4109,7 @@
1788
Aufgeschobene Einfuhr-Umsatzsteuer
-
+
@@ -6786,7 +6786,7 @@
3551
- Wareneingang, im Drittland steuerbar
+ Wareneingang, im Drittland steuerbar (19%)
@@ -6808,6 +6808,14 @@
+
+ 3557
+ Wareneingang, im Drittland steuerbar (7%)
+
+
+
+
+
3558
Wareneingang, im anderen EG-Land stb.
@@ -9739,7 +9747,7 @@
8738
- Gewährte Skonti aus Lieferungen von Mobilfunkgeräten/Schaltkreisen, für die der Leistungsempfänger die Umsatzsteuer nach § 13b UStG schuldet
+ Gewährte Skonti aus Lieferungen von Mobilfunkgeräten/Schaltkreisen, für die der Leistungsempfänger die Umsatzsteuer nach § 13b Abs. 2 Nr. 10 UStG schuldet
@@ -10268,6 +10276,13 @@
+
+ 9089
+ Offene Posten aus 2019
+
+
+
+
4
@@ -10281,4 +10296,4 @@
-
\ No newline at end of file
+
diff --git a/addons/l10n_de_skr04/data/account_tax_fiscal_position_data.xml b/addons/l10n_de_skr04/data/account_tax_fiscal_position_data.xml
index 83668698edf..143c95210cc 100644
--- a/addons/l10n_de_skr04/data/account_tax_fiscal_position_data.xml
+++ b/addons/l10n_de_skr04/data/account_tax_fiscal_position_data.xml
@@ -77,7 +77,74 @@
-
+
+ 97
+
+ 19% Umsatzsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 19% USt innerg. Erw. - 0% Vorsteuer
+ percent
+ -19
+
+
+ none
+
+
+
+
+ 97
+
+ 19% Vorsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 19% VSt innerg. Erw. - 0% Vorsteuer
+ percent
+ 19
+ none
+
+
+
+ 20
+
+ Innergem. Erwerb 19%USt/0%VSt
+ innergem. Erwerb 19% - 0% Vorsteuer
+ group
+ 0
+ purchase
+
+
+
+
+ 97
+
+ 7% Umsatzsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 7% USt innerg. Erw. - 0% Vorsteuer
+ percent
+ -7
+
+
+ none
+
+
+
+
+ 97
+
+ 7% Vorsteuer aus innergem. Erwerb (kein Vorsteuerabzug)
+ 7% VSt innerg. Erw. - 0% Vorsteuer
+ percent
+ 7
+ none
+
+
+
+ 20
+
+ Innergem. Erwerb 7%USt/0%VSt
+ innergem. Erwerb 7% - 0% Vorsteuer
+ group
+ 0
+ purchase
+
+
+
99
@@ -161,31 +228,77 @@
- 20
+ 98
- 19% Einfuhrumsatzsteuer
- 19% EUSt
+ 19% Einfuhrumsatzsteuer (abzugsf. Vorsteuer)
+ 19% EUSt (abzugsf. Vorsteuer)
percent
19
- purchase
+ none
-
+
+ 98
+
+ 19% Einfuhrumsatzsteuer (zu bezahlender Aufschub)
+ 19% EUSt (zu bezahlender Aufschub)
+ percent
+ -19
+
+
+ none
+
+
+
21
- 7% Einfuhrumsatzsteuer
- 7% EUSt
+ 19% Einfuhrumsatzsteuer (§21 Abs.3 UstG)
+ Einfuhrumsatzsteuer 19%
+ group
+ 0
+ purchase
+
+
+
+
+ 98
+
+ 7% Einfuhrumsatzsteuer (abzugsf. Vorsteuer)
+ 7% EUSt (abzugsf. Vorsteuer)
percent
7
- purchase
+ none
+
+ 98
+
+ 7% Einfuhrumsatzsteuer (zu bezahlender Aufschub)
+ 7% EUSt (zu bezahlender Aufschub)
+ percent
+ -7
+
+
+ none
+
+
+
+ 21
+
+ 7% Einfuhrumsatzsteuer (§21 Abs.3 UstG)
+ Einfuhrumsatzsteuer 7%
+ group
+ 0
+ purchase
+
+
+
22
@@ -965,23 +1078,37 @@
-
+
+ 1
+ Geschäftspartner Inland
- Dienstleister Ausland
+
+
+
+
+ 6
+
+ Dienstleister Ausland (Nicht-EU)
+ 5
- Geschäftspartner Ausland
+ Geschäftspartner Ausland (Nicht-EU)
+ 2
Geschäftspartner EU (mit USt-ID)
+
+
+ 3
Dienstleister EU (mit USt-ID)
+ 4
Geschäftspartner EU (ohne USt-ID)
@@ -1017,12 +1144,12 @@
-
+
-
+
@@ -1052,7 +1179,7 @@
-
+
@@ -1062,7 +1189,7 @@
-
+
@@ -1134,7 +1261,7 @@
-
+
@@ -1144,7 +1271,7 @@
-
+
@@ -1201,17 +1328,21 @@
-
+
+
+
+
+
-
+
-
+
@@ -1243,11 +1374,15 @@
-
+
-
+
+
+
+
+
@@ -1255,7 +1390,7 @@
-
+
@@ -1278,6 +1413,10 @@
+
+
+
+
@@ -1291,11 +1430,11 @@
-
+
-
+
@@ -1323,7 +1462,7 @@
-
+
@@ -1378,6 +1517,14 @@
+
+
+
+
+
+
+
+
@@ -1395,11 +1542,11 @@
-
+
-
+
@@ -1411,7 +1558,7 @@
-
+
@@ -1419,11 +1566,11 @@
-
+
-
+
@@ -1455,7 +1602,7 @@
-
+
@@ -1463,7 +1610,7 @@
-
+
@@ -1510,6 +1657,14 @@
+
+
+
+
+
+
+
+
@@ -1539,17 +1694,25 @@
-
+
-
+
+
+
+
+
+
+
+
+
@@ -1721,7 +1884,7 @@
-
+
diff --git a/addons/l10n_de_skr04/data/l10n_de_skr04_chart_data.xml b/addons/l10n_de_skr04/data/l10n_de_skr04_chart_data.xml
index bf2d228287c..5d466ee3f35 100644
--- a/addons/l10n_de_skr04/data/l10n_de_skr04_chart_data.xml
+++ b/addons/l10n_de_skr04/data/l10n_de_skr04_chart_data.xml
@@ -4415,7 +4415,7 @@
3850
Aufgeschobene Einfuhrumsatzsteuer
-
+
@@ -4732,6 +4732,14 @@
+
+ 4564
+ Provisionsumsätze (§4Nr.8ff.UStG)
+
+
+
+
+
4566
Provisionsumsätze 7 % USt
@@ -5836,6 +5844,22 @@
+
+ 5166
+ Einkauf Roh-, Hilfs- und Betriebsstoffe, innergemeinschaftlicher Erwerb ohne Vorsteuer und 7 % Umsatzsteuer
+
+
+
+
+
+
+ 5167
+ Einkauf Roh-, Hilfs- und Betriebsstoffe, innergemeinschaftlicher Erwerb ohne Vorsteuer und 19 % Umsatzsteuer
+
+
+
+
+
5189
Erwerb Roh-, Hilfs- und Betriebsstoffe letzter Abnehmer Dreiecksgeschäft
@@ -5938,6 +5962,30 @@
+
+ 5550
+ Steuerfreier EG-Erwerb
+
+
+
+
+
+
+ 5551
+ Wareneingang, im Drittland steuerbar (19%)
+
+
+
+
+
+
+ 5552
+ Erwerb 1. Abnehmer im Dreiecksgeschäft
+
+
+
+
+
5553
Erwerb Waren als letzter Abnehmer innerhalb Dreiecksgeschäft
@@ -5946,6 +5994,14 @@
+
+ 5557
+ Wareneingang, im Drittland steuerbar (7%)
+
+
+
+
+
5559
Steuerfreie Einfuhren
diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py
index becca5a266a..2e88bf0cff4 100644
--- a/addons/point_of_sale/models/pos_order.py
+++ b/addons/point_of_sale/models/pos_order.py
@@ -721,7 +721,7 @@ class PosOrder(models.Model):
try:
pos_order.action_pos_order_paid()
- except psycopg2.OperationalError:
+ except psycopg2.DatabaseError:
# do not hide transactional errors, the order(s) won't be saved!
raise
except Exception as e:
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 1b4ba84437c..99f68e601ad 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -2659,7 +2659,7 @@ exports.NumpadState = Backbone.Model.extend({
this.set({
buffer: "-" + newChar
});
- } else {
+ } else if (!(newChar === '.') || oldBuffer.indexOf('.') === -1) {
this.set({
buffer: (this.get('buffer')) + newChar
});
diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py
index 58133887565..4f7b15d8627 100644
--- a/addons/purchase/models/account_invoice.py
+++ b/addons/purchase/models/account_invoice.py
@@ -83,6 +83,12 @@ class AccountInvoice(models.Model):
if not self.invoice_line_ids:
#as there's no invoice line yet, we keep the currency of the PO
self.currency_id = self.purchase_id.currency_id
+
+ vendor_ref = self.purchase_id.partner_ref
+ if vendor_ref:
+ self.reference = ", ".join([self.reference, vendor_ref]) if (
+ self.reference and vendor_ref not in self.reference) else vendor_ref
+
new_lines = self.env['account.invoice.line']
for line in self.purchase_id.order_line - self.invoice_line_ids.mapped('purchase_line_id'):
data = self._prepare_invoice_line_from_po_line(line)
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py
index 6a9f88e39a8..178a077c19e 100644
--- a/addons/stock_account/models/product.py
+++ b/addons/stock_account/models/product.py
@@ -202,18 +202,30 @@ class ProductProduct(models.Model):
for row in res:
fifo_automated_values[(row[0], row[1])] = (row[2], row[3], list(row[4]))
- product_values = {product: 0 for product in self}
- product_move_ids = {product: [] for product in self}
+ product_values = {product.id: 0 for product in self}
+ product_move_ids = {product.id: [] for product in self}
+
if to_date:
domain = [('product_id', 'in', self.ids), ('date', '<=', to_date)] + StockMove._get_all_base_domain()
- for move in StockMove.search(domain).with_context(prefetch_fields=False):
- product_values[move.product_id] += move.value
- product_move_ids[move.product_id].append(move.id)
+ value_field_name = 'value'
else:
domain = [('product_id', 'in', self.ids)] + StockMove._get_all_base_domain()
- for move in StockMove.search(domain).with_context(prefetch_fields=False):
- product_values[move.product_id] += move.remaining_value
- product_move_ids[move.product_id].append(move.id)
+ value_field_name = 'remaining_value'
+
+ StockMove.check_access_rights('read')
+ query = StockMove._where_calc(domain)
+ StockMove._apply_ir_rules(query, 'read')
+ from_clause, where_clause, params = query.get_sql()
+ query_str = """
+ SELECT stock_move.product_id, SUM(COALESCE(stock_move.{}, 0.0)), ARRAY_AGG(stock_move.id)
+ FROM {}
+ WHERE {}
+ GROUP BY stock_move.product_id
+ """.format(value_field_name, from_clause, where_clause)
+ self.env.cr.execute(query_str, params)
+ for product_id, value, move_ids in self.env.cr.fetchall():
+ product_values[product_id] = value
+ product_move_ids[product_id] = move_ids
for product in self:
if product.cost_method in ['standard', 'average']:
@@ -229,9 +241,9 @@ class ProductProduct(models.Model):
elif product.cost_method == 'fifo':
if to_date:
if product.product_tmpl_id.valuation == 'manual_periodic':
- product.stock_value = product_values[product]
+ product.stock_value = product_values[product.id]
product.qty_at_date = product.with_context(company_owned=True, owner_id=False).qty_available
- product.stock_fifo_manual_move_ids = StockMove.browse(product_move_ids[product])
+ product.stock_fifo_manual_move_ids = StockMove.browse(product_move_ids[product.id])
elif product.product_tmpl_id.valuation == 'real_time':
valuation_account_id = product.categ_id.property_stock_valuation_account_id.id
value, quantity, aml_ids = fifo_automated_values.get((product.id, valuation_account_id)) or (0, 0, [])
@@ -239,10 +251,10 @@ class ProductProduct(models.Model):
product.qty_at_date = quantity
product.stock_fifo_real_time_aml_ids = self.env['account.move.line'].browse(aml_ids)
else:
- product.stock_value, moves = product_values[product], StockMove.browse(product_move_ids[product])
+ product.stock_value = product_values[product.id]
product.qty_at_date = product.with_context(company_owned=True, owner_id=False).qty_available
if product.product_tmpl_id.valuation == 'manual_periodic':
- product.stock_fifo_manual_move_ids = moves
+ product.stock_fifo_manual_move_ids = StockMove.browse(product_move_ids[product.id])
elif product.product_tmpl_id.valuation == 'real_time':
valuation_account_id = product.categ_id.property_stock_valuation_account_id.id
value, quantity, aml_ids = fifo_automated_values.get((product.id, valuation_account_id)) or (0, 0, [])
diff --git a/addons/website_sale/models/res_config_settings.py b/addons/website_sale/models/res_config_settings.py
index 287b21450ab..4a96ced5504 100644
--- a/addons/website_sale/models/res_config_settings.py
+++ b/addons/website_sale/models/res_config_settings.py
@@ -9,10 +9,7 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
def _default_order_mail_template(self):
- if self.env['ir.module.module'].search([('name', '=', 'website_quote')]).state in ('installed', 'to upgrade'):
- return self.env.ref('website_quote.confirmation_mail').id
- else:
- return self.env.ref('sale.email_template_edi_sale').id
+ return self.env.ref('sale.email_template_edi_sale').id
def _default_recovery_mail_template(self):
try:
diff --git a/requirements.txt b/requirements.txt
index 4619d232b1f..a94a69d628c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -8,7 +8,7 @@ gevent==1.3.4 ; sys_platform != 'win32' and python_version >= '3.7'
greenlet==0.4.10 ; python_version < '3.7'
greenlet==0.4.13 ; python_version >= '3.7'
html2text==2016.9.19
-Jinja2==2.8.1
+Jinja2==2.10.1
lxml==3.7.1 ; sys_platform != 'win32' and python_version < '3.7'
lxml==4.2.3 ; sys_platform != 'win32' and python_version >= '3.7'
lxml ; sys_platform == 'win32'
diff --git a/setup/win32/winpy_requirements.txt b/setup/win32/winpy_requirements.txt
index f998d871af2..90a4a001195 100644
--- a/setup/win32/winpy_requirements.txt
+++ b/setup/win32/winpy_requirements.txt
@@ -6,7 +6,7 @@ feedparser==5.2.1
gevent>=1.1.2
greenlet>=0.4.10
html2text==2016.9.19
-Jinja2==2.8
+Jinja2==2.10.1
lxml>=3.5.0
Mako==1.0.4
MarkupSafe==0.23