Skip to content
Commits on Source (58)
......@@ -12833,6 +12833,8 @@ msgstr ""
msgid ""
"The move could not be posted for the following reason: %(error_message)s"
msgstr ""
"El asiento no se puede publicar debido al siguiente motivo: "
"%(error_message)s"
 
#. module: account
#: model:ir.model.fields,help:account.field_account_move_line__move_id
......
......@@ -38,10 +38,10 @@
# Kim Asplund <kim.asplund@gmail.com>, 2022
# Tuomo Aura <tuomo.aura@web-veistamo.fi>, 2022
# Veikko Väätäjä <veikko.vaataja@gmail.com>, 2022
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2023
# Konsta Aavaranta, 2023
# Kari Lindgren <kari.lindgren@emsystems.fi>, 2023
# Ossi Mantylahti <ossi.mantylahti@obs-solutions.fi>, 2023
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2023
#
msgid ""
msgstr ""
......@@ -49,7 +49,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-25 10:15+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Ossi Mantylahti <ossi.mantylahti@obs-solutions.fi>, 2023\n"
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2023\n"
"Language-Team: Finnish (https://app.transifex.com/odoo/teams/41243/fi/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -4289,7 +4289,7 @@ msgstr "Asiakaslasku"
#: model_terms:ir.ui.view,arch_db:account.res_partner_view_search
#, python-format
msgid "Customer Invoices"
msgstr "Asiakkaan laskut"
msgstr "Laskutusasiakkaat"
 
#. module: account
#: code:addons/account/models/account_payment.py:0
......
......@@ -3123,13 +3123,13 @@ msgstr "Cash Statement"
#: code:addons/account/models/account_bank_statement.py:0
#, python-format
msgid "Cash difference observed during the counting (Loss)"
msgstr ""
msgstr "Perbedaan kas yang ditemukan pada perhitungan (Rugi)"
 
#. module: account
#: code:addons/account/models/account_bank_statement.py:0
#, python-format
msgid "Cash difference observed during the counting (Profit)"
msgstr ""
msgstr "Perbedaan kas yang ditemukan pada perhitungan (Laba)"
 
#. module: account
#: code:addons/account/models/account_journal_dashboard.py:0
......@@ -9615,7 +9615,7 @@ msgstr "Impor QIF"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_payment__qr_code
msgid "QR Code"
msgstr ""
msgstr "Kode QR"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.res_config_settings_view_form
......
......@@ -323,7 +323,7 @@ msgstr ""
" La preghiamo di provvedere quanto prima al pagamento.\n"
" % if object.payment_reference:\n"
" <br/><br/>\n"
" Per il pagamento utilizzare la seguente indicazione: <strong>${object.payment_reference}</strong>.\n"
" Per il pagamento utilizzare le seguenti informazioni: <strong>${object.payment_reference}</strong>.\n"
" % endif\n"
" % endif\n"
" <br/><br/>\n"
......@@ -9392,7 +9392,7 @@ msgstr ""
#. module: account
#: model_terms:ir.ui.view,arch_db:account.report_invoice_document
msgid "Please use the following communication for your payment :"
msgstr "Per il pagamento utilizzare la seguente indicazione:"
msgstr "Per il pagamento utilizzare le seguenti informazioni:"
 
#. module: account
#: model:ir.model.fields,field_description:account.field_account_tax_repartition_line_template__plus_report_line_ids
......@@ -14299,7 +14299,7 @@ msgstr "Visualizza"
#. module: account
#: model_terms:ir.ui.view,arch_db:account.view_partner_property_form
msgid "View accounts detail"
msgstr "Visualizza dettagli dei conti"
msgstr "Visualizza dettaglio dei conti"
 
#. module: account
#: model:ir.model.fields.selection,name:account.selection__res_partner__invoice_warn__warning
......@@ -14580,8 +14580,8 @@ msgid ""
"invoices, once validated, to help the customer to refer to that particular "
"invoice when making the payment."
msgstr ""
"Qui è possibile impostare la comunicazione predefinita che comparirà nelle "
"fatture dopo la validazione, per fornire al cliente un riferimento a una "
"Qui è possibile impostare le informazioni predefinite che compariranno nelle"
" fatture dopo la validazione, per fornire al cliente un riferimento a una "
"specifica fattura al momento del pagamento."
 
#. module: account
......
......@@ -10014,7 +10014,7 @@ msgstr "丸め精度"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_cash_rounding__strategy
msgid "Rounding Strategy"
msgstr "丸め戦略"
msgstr "丸め方針"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.rounding_tree_view
......
......@@ -9362,7 +9362,7 @@ msgstr "QIF 가져오기"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_payment__qr_code
msgid "QR Code"
msgstr ""
msgstr "QR 코드"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.res_config_settings_view_form
......
......@@ -29,6 +29,7 @@
# Martin Trigaux, 2022
# Sanjaajamts Badamjunai <b.sanjaajamtsfc@gmail.com>, 2023
# Torbat Jargalsaikhan, 2023
# Munkhbaatar Gombosuren, 2023
#
msgid ""
msgstr ""
......@@ -36,7 +37,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-25 10:15+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Torbat Jargalsaikhan, 2023\n"
"Last-Translator: Munkhbaatar Gombosuren, 2023\n"
"Language-Team: Mongolian (https://app.transifex.com/odoo/teams/41243/mn/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -9413,7 +9414,7 @@ msgstr "Батлагдсан"
#: model:ir.model.fields,field_description:account.field_account_move__posted_before
#: model:ir.model.fields,field_description:account.field_account_payment__posted_before
msgid "Posted Before"
msgstr ""
msgstr "Өмнө нь баталгаажсан"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.view_account_move_filter
......@@ -12299,6 +12300,8 @@ msgstr ""
msgid ""
"The credit note is created in draft and can be edited before being issued."
msgstr ""
"Нэхэмжлэл үүсэхдээ ноорог төлөвтэй байдаг тул батлахаас өмнө зохих засварыг "
"оруулж болно."
 
#. module: account
#: model:ir.model.fields,help:account.field_account_journal__currency_id
......
......@@ -7,13 +7,13 @@
# Fredrik Ahlsen <fredrik@gdx.no>, 2020
# Jens Nymoen <jens@nettimport.no>, 2021
# Mads Søndergaard, 2021
# Martin Trigaux, 2022
# Lars Aam <lars.aam@vikenfiber.no>, 2022
# Henrik Norlin <henrik@appstogrow.net>, 2022
# Marius Stedjan <marius@stedjan.com>, 2022
# Thor Arne Hvidsten, 2022
# Thor Arne Hvidsten <thor.arne.hvidsten@gmail.com>, 2023
# Henning Fyllingsnes, 2023
# Martin Trigaux, 2023
#
msgid ""
msgstr ""
......@@ -21,7 +21,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-25 10:15+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Henning Fyllingsnes, 2023\n"
"Last-Translator: Martin Trigaux, 2023\n"
"Language-Team: Norwegian Bokmål (https://app.transifex.com/odoo/teams/41243/nb/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -9816,13 +9816,13 @@ msgstr ""
#: model:ir.model.fields,field_description:account.field_account_move__reversed_entry_id
#: model:ir.model.fields,field_description:account.field_account_payment__reversed_entry_id
msgid "Reversal of"
msgstr ""
msgstr "Kreditering av"
 
#. module: account
#: code:addons/account/wizard/account_move_reversal.py:0
#, python-format
msgid "Reversal of: %(move_name)s, %(reason)s"
msgstr ""
msgstr "Kreditering av: %(move_name)s, %(reason)s"
 
#. module: account
#: code:addons/account/models/account_full_reconcile.py:0
......@@ -9830,7 +9830,7 @@ msgstr ""
#: code:addons/account/wizard/account_move_reversal.py:0
#, python-format
msgid "Reversal of: %s"
msgstr ""
msgstr "Kreditering av %s"
 
#. module: account
#: model:ir.actions.act_window,name:account.action_view_account_move_reversal
......@@ -12143,6 +12143,13 @@ msgid ""
" e.g: .*N°48748 abc123.*"
msgstr ""
 
#. module: account
#: code:addons/account/models/account_move.py:0
#, python-format
msgid ""
"The move could not be posted for the following reason: %(error_message)s"
msgstr ""
#. module: account
#: model:ir.model.fields,help:account.field_account_move_line__move_id
msgid "The move of this entry line."
......
......@@ -38,12 +38,12 @@
# IT WEDOO, 2022
# Jacek Michalski <michalski.jck@gmail.com>, 2022
# Piotr Szlązak <szlazakpiotr@gmail.com>, 2022
# Paweł Wodyński <pw@myodoo.pl>, 2022
# Maksym <ms@myodoo.pl>, 2022
# danielkowalczyk007, 2023
# Tadeusz Karpiński <tadeusz.karpinski@braintec.com>, 2023
# Samuek Kobylarz, 2023
# Tadeusz Karpiński <tadeuszkarpinski@gmail.com>, 2023
# Paweł Wodyński <pw@myodoo.pl>, 2023
#
msgid ""
msgstr ""
......@@ -51,7 +51,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-25 10:15+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Tadeusz Karpiński <tadeuszkarpinski@gmail.com>, 2023\n"
"Last-Translator: Paweł Wodyński <pw@myodoo.pl>, 2023\n"
"Language-Team: Polish (https://app.transifex.com/odoo/teams/41243/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -13715,7 +13715,7 @@ msgstr "Kwota nieopodatkowana podpisana"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_invoice_report__price_subtotal
msgid "Untaxed Total"
msgstr "Untaxed Total"
msgstr "Ogółem Netto"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.view_move_form
......
......@@ -33,9 +33,9 @@
# Martin Trigaux, 2022
# valmasone, 2022
# Alena Vlasova, 2023
# alenafairy, 2023
# Elena Da, 2023
# Сергей Шебанин <sergey@shebanin.ru>, 2023
# alenafairy, 2023
#
msgid ""
msgstr ""
......@@ -43,7 +43,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-25 10:15+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Сергей Шебанин <sergey@shebanin.ru>, 2023\n"
"Last-Translator: alenafairy, 2023\n"
"Language-Team: Russian (https://app.transifex.com/odoo/teams/41243/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -10609,7 +10609,7 @@ msgstr "Регулярное выражение переопределения
#: model:ir.model.fields,field_description:account.field_account_payment__sequence_prefix
#: model:ir.model.fields,field_description:account.field_sequence_mixin__sequence_prefix
msgid "Sequence Prefix"
msgstr ""
msgstr "Префикс последовательности"
 
#. module: account
#: model:ir.model.fields,help:account.field_account_tax_report_line__sequence
......@@ -12401,6 +12401,13 @@ msgid ""
" e.g: .*N°48748 abc123.*"
msgstr ""
 
#. module: account
#: code:addons/account/models/account_move.py:0
#, python-format
msgid ""
"The move could not be posted for the following reason: %(error_message)s"
msgstr ""
#. module: account
#: model:ir.model.fields,help:account.field_account_move_line__move_id
msgid "The move of this entry line."
......
......@@ -3080,13 +3080,13 @@ msgstr "งบเงินสด"
#: code:addons/account/models/account_bank_statement.py:0
#, python-format
msgid "Cash difference observed during the counting (Loss)"
msgstr ""
msgstr "ผลต่างของเงินสดที่สังเกตได้ในระหว่างการนับ (ขาดทุน)"
 
#. module: account
#: code:addons/account/models/account_bank_statement.py:0
#, python-format
msgid "Cash difference observed during the counting (Profit)"
msgstr ""
msgstr "ผลต่างของเงินสดที่สังเกตได้ในระหว่างการนับ (กำไร)"
 
#. module: account
#: code:addons/account/models/account_journal_dashboard.py:0
......@@ -9132,6 +9132,8 @@ msgid ""
"Please go on the %s journal and define a Loss Account. This account will be "
"used to record cash difference."
msgstr ""
"โปรดไปที่สมุดรายวัน %s และกำหนดบัญชีการสูญเสีย "
"บัญชีนี้จะใช้ในการบันทึกผลต่างเงินสด"
 
#. module: account
#: code:addons/account/models/account_bank_statement.py:0
......@@ -9140,6 +9142,8 @@ msgid ""
"Please go on the %s journal and define a Profit Account. This account will "
"be used to record cash difference."
msgstr ""
"โปรดไปที่สมุดรายวัน %s และกำหนดบัญชีกำไร "
"บัญชีนี้จะใช้ในการบันทึกผลต่างเงินสด"
 
#. module: account
#: code:addons/account/models/company.py:0
......@@ -13108,6 +13112,9 @@ msgid ""
"including from the Technical menu in the Settings, in order to preserve "
"storage space of your Odoo database."
msgstr ""
"ตัวเลือกนี้จะลบการติดตามอีเมลหลังจากถูกส่งอย่างถาวร "
"รวมถึงจากเมนูทางเทคนิคในการตั้งค่า "
"เพื่อรักษาพื้นที่จัดเก็บข้อมูลของฐานข้อมูล Odoo ของคุณ"
 
#. module: account
#: model:ir.model.fields,help:account.field_account_account_template__chart_template_id
......
......@@ -332,12 +332,12 @@ msgstr "<i class=\"fa fa-calendar\"/> 從"
#: model_terms:ir.ui.view,arch_db:account.account_move_line_view_kanban
#: model_terms:ir.ui.view,arch_db:account.view_account_move_kanban
msgid "<i class=\"fa fa-clock-o\" aria-label=\"Date\" role=\"img\" title=\"Date\"/>"
msgstr "<i class=\"fa fa-clock-o\" aria-label=\"Date\" role=\"img\" title=\"Date\"/>"
msgstr "<i class=\"fa fa-clock-o\" aria-label=\"日期\" role=\"img\" title=\"日期\"/>"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.view_account_payment_kanban
msgid "<i class=\"fa fa-clock-o\" role=\"img\" aria-label=\"Date\" title=\"Date\"/>"
msgstr "<i class=\"fa fa-clock-o\" role=\"img\" aria-label=\"Date\" title=\"Date\"/>"
msgstr "<i class=\"fa fa-clock-o\" role=\"img\" aria-label=\"日期\" title=\"日期\"/>"
 
#. module: account
#: model_terms:ir.ui.view,arch_db:account.portal_invoice_page
......@@ -6385,7 +6385,7 @@ msgstr "開立憑單日期"
#: model:ir.model.fields,field_description:account.field_account_move__invoice_filter_type_domain
#: model:ir.model.fields,field_description:account.field_account_payment__invoice_filter_type_domain
msgid "Invoice Filter Type Domain"
msgstr "憑單篩選類型"
msgstr "發票篩選類型範圍"
 
#. module: account
#: model:ir.model.fields,field_description:account.field_account_bank_statement_line__invoice_has_matching_suspense_amount
......@@ -13012,7 +13012,7 @@ msgstr "應收總計"
#: model:ir.model.fields,field_description:account.field_account_move__amount_total_signed
#: model:ir.model.fields,field_description:account.field_account_payment__amount_total_signed
msgid "Total Signed"
msgstr "總簽字"
msgstr "已簽署總額"
 
#. module: account
#: model:ir.model.fields,help:account.field_account_automatic_entry_wizard__total_amount
......
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo.addons.base.models.decimal_precision import DecimalPrecision
from odoo.exceptions import RedirectWarning, UserError, ValidationError, AccessError
from odoo.tools import float_compare, date_utils, email_split, email_re, float_is_zero
from odoo.tools.misc import formatLang, format_date, get_lang
......@@ -8,9 +9,11 @@ from odoo.osv import expression
from datetime import date, timedelta
from collections import defaultdict
from contextlib import contextmanager
from itertools import zip_longest
from hashlib import sha256
from json import dumps
from unittest.mock import patch
import ast
import json
......@@ -3192,6 +3195,21 @@ class AccountMove(models.Model):
return rslt
@contextmanager
def _disable_discount_precision(self):
"""Disable the user defined precision for discounts.
This is useful for importing documents coming from other softwares and providers.
The reasonning is that if the document that we are importing has a discount, it
shouldn't be rounded to the local settings.
"""
original_precision_get = DecimalPrecision.precision_get
def precision_get(self, application):
if application == 'Discount':
return 100
return original_precision_get(self, application)
with patch('odoo.addons.base.models.decimal_precision.DecimalPrecision.precision_get', new=precision_get):
yield
def _message_post_after_hook(self, new_message, message_values):
# OVERRIDE
# When posting a message, check the attachment to see if it's an invoice and update with the imported data.
......@@ -3220,9 +3238,10 @@ class AccountMove(models.Model):
# start with message_main_attachment_id, that way if OCR is installed, only that one will be parsed.
# this is based on the fact that the ocr will be the last decoder.
for attachment in attachments.sorted(lambda x: x != self.message_main_attachment_id):
invoice = decoder[1](attachment, self)
if invoice:
return res
with self._disable_discount_precision():
invoice = decoder[1](attachment, self)
if invoice:
return res
return res
......
......@@ -750,12 +750,12 @@ class AccountReconcileModel(models.Model):
# to the query to only search on move lines that are younger than this limit.
if self.past_months_limit:
date_limit = fields.Date.context_today(self) - relativedelta(months=self.past_months_limit)
query += "AND aml.date >= %(aml_date_limit)s"
query += " AND aml.date >= %(aml_date_limit)s"
params['aml_date_limit'] = date_limit
# Filter out excluded account.move.line.
if excluded_ids:
query += 'AND aml.id NOT IN %(excluded_aml_ids)s'
query += ' AND aml.id NOT IN %(excluded_aml_ids)s'
params['excluded_aml_ids'] = tuple(excluded_ids)
if self.matching_order == 'new_first':
......
......@@ -18,7 +18,7 @@ TYPE_TAX_USE = [
class AccountTaxGroup(models.Model):
_name = 'account.tax.group'
_description = 'Tax Group'
_order = 'sequence asc'
_order = 'sequence asc, id'
name = fields.Char(required=True, translate=True)
sequence = fields.Integer(default=10)
......
......@@ -14,3 +14,13 @@ class ResPartnerBank(models.Model):
for bank in self:
if len(bank.journal_id) > 1:
raise ValidationError(_('A bank account can belong to only one journal.'))
def default_get(self, fields_list):
if 'acc_number' not in fields_list:
return super().default_get(fields_list)
# When create & edit, `name` could be used to pass (in the context) the
# value input by the user. However, we want to set the default value of
# `acc_number` variable instead.
default_acc_number = self._context.get('default_acc_number', False) or self._context.get('default_name', False)
return super(ResPartnerBank, self.with_context(default_acc_number=default_acc_number)).default_get(fields_list)
......@@ -58,7 +58,7 @@
</menuitem>
<menuitem id="account_banks_menu" name="Banks" groups="account.group_account_manager" sequence="2">
<menuitem id="menu_action_account_bank_journal_form" action="action_new_bank_setting" groups="account.group_account_manager" sequence="1"/>
<menuitem id="action_account_reconcile_model_menu" action="account.action_account_reconcile_model" sequence="3" />
<menuitem id="action_account_reconcile_model_menu" action="account.action_account_reconcile_model" sequence="3" groups="account.group_account_user"/>
</menuitem>
<menuitem id="account_account_menu" name="Accounting" groups="account.group_account_manager" sequence="3">
<menuitem id="menu_action_account_form" action="action_account_form" groups="account.group_account_readonly" sequence="1"/>
......
......@@ -5,8 +5,8 @@
# Translators:
# Cécile Collart <cco@odoo.com>, 2021
# Daniela Cervantes <dace@odoo.com>, 2021
# Fernanda Alvarez, 2023
# Patricia Gutiérrez Capetillo <pagc@odoo.com>, 2023
# Fernanda Alvarez, 2023
#
msgid ""
msgstr ""
......@@ -14,7 +14,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-01 07:28+0000\n"
"PO-Revision-Date: 2020-09-07 08:09+0000\n"
"Last-Translator: Patricia Gutiérrez Capetillo <pagc@odoo.com>, 2023\n"
"Last-Translator: Fernanda Alvarez, 2023\n"
"Language-Team: Spanish (Mexico) (https://app.transifex.com/odoo/teams/41243/es_MX/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
......@@ -185,7 +185,7 @@ msgstr "Ir al panel de configuración"
#: model:ir.model.fields,field_description:account_check_printing.field_res_config_settings__id
#: model:ir.model.fields,field_description:account_check_printing.field_res_partner__id
msgid "ID"
msgstr "Identificación"
msgstr "ID"
#. module: account_check_printing
#: code:addons/account_check_printing/models/account_payment.py:0
......
......@@ -632,19 +632,24 @@ class AccountEdiFormat(models.Model):
# cut Sales Description from the name
name = name.split('\n')[0]
domains = []
for value, domain in (
(name, ('name', 'ilike', name)),
(default_code, ('default_code', '=', default_code)),
(barcode, ('barcode', '=', barcode)),
):
if value is not None:
domains.append([domain])
domain = expression.AND([
expression.OR(domains),
[('company_id', 'in', [False, self.env.company.id])],
])
return self.env['product.product'].search(domain, limit=1)
if default_code:
domains.append([('default_code', '=', default_code)])
if barcode:
domains.append([('barcode', '=', barcode)])
# Search for the product with the exact name, then ilike the name
name_domains = [('name', '=', name)], [('name', 'ilike', name)] if name else []
for name_domain in name_domains:
product = self.env['product.product'].search(
expression.AND([
expression.OR(domains + [name_domain]),
[('company_id', 'in', [False, self.env.company.id])],
]),
limit=1,
)
if product:
return product
return self.env['product.product']
def _retrieve_tax(self, amount, type_tax_use):
'''Search all taxes and find one that matches all of the parameters.
......
......@@ -595,7 +595,7 @@ class AccountEdiCommon(models.AbstractModel):
elif net_price_unit is not None:
price_unit = (net_price_unit + rebate) / basis_qty
elif price_subtotal is not None:
price_unit = (price_subtotal + allow_charge_amount) / billed_qty
price_unit = (price_subtotal + allow_charge_amount) / (billed_qty or 1)
else:
raise UserError(_("No gross price, net price nor line subtotal amount found for line in xml"))
......@@ -677,11 +677,16 @@ class AccountEdiCommon(models.AbstractModel):
# Set the values on the line_form
invoice_line_form.quantity = inv_line_vals['quantity']
if inv_line_vals.get('product_uom_id'):
invoice_line_form.product_uom_id = inv_line_vals['product_uom_id']
else:
if not inv_line_vals.get('product_uom_id'):
logs.append(
_("Could not retrieve the unit of measure for line with label '%s'.", invoice_line_form.name))
elif not invoice_line_form.product_id:
# no product set on the line, no need to check uom compatibility
invoice_line_form.product_uom_id = inv_line_vals['product_uom_id']
elif inv_line_vals['product_uom_id'].category_id == invoice_line_form.product_id.product_tmpl_id.uom_id.category_id:
# needed to check that the uom is compatible with the category of the product
invoice_line_form.product_uom_id = inv_line_vals['product_uom_id']
invoice_line_form.price_unit = inv_line_vals['price_unit']
invoice_line_form.discount = inv_line_vals['discount']
invoice_line_form.tax_ids.clear()
......