Skip to content

Commit

Permalink
Merge remote-tracking branch 'odoo/13.0' into 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed Feb 24, 2021
2 parents 807dbf2 + 39738f2 commit ca62572
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 13 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -14,6 +14,7 @@ recursive-include odoo *.ico
recursive-include odoo *.jpeg
recursive-include odoo *.jpg
recursive-include odoo *.js
recursive-include odoo *.json
recursive-include odoo *.md
recursive-include odoo *.mp3
recursive-include odoo *.ogg
Expand Down
4 changes: 3 additions & 1 deletion addons/account/models/ir_actions_report.py
Expand Up @@ -29,5 +29,7 @@ def postprocess_pdf_report(self, record, buffer):
return None
res = super(IrActionsReport, self).postprocess_pdf_report(record, buffer)
if self.model == 'account.move' and record.state == 'posted' and record.is_sale_document(include_receipts=True):
self.retrieve_attachment(record).register_as_main_attachment(force=False)
attachment = self.retrieve_attachment(record)
if attachment:
attachment.register_as_main_attachment(force=False)
return res
2 changes: 1 addition & 1 deletion addons/l10n_ar/__manifest__.py
Expand Up @@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Argentinian Accounting',
'version': "3.0",
'version': "3.1",
'description': """
Functional
----------
Expand Down
34 changes: 34 additions & 0 deletions addons/l10n_ar/i18n/es.po
Expand Up @@ -207,16 +207,19 @@ msgid "AFIP Concept"
msgstr "Concepto AFIP"

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_partner_id
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_partner_id
msgid "AFIP POS Address"
msgstr "Dirección PdV AFIP"

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_number
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_number
msgid "AFIP POS Number"
msgstr "Número PdV AFIP"

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_system
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_system
msgid "AFIP POS System"
msgstr "Sistema PdV AFIP"
Expand Down Expand Up @@ -1042,6 +1045,7 @@ msgid "Sequence"
msgstr "Secuencia"

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_sequence_ids
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_sequence_ids
msgid "Sequences"
msgstr "Secuencias"
Expand Down Expand Up @@ -1168,12 +1172,14 @@ msgstr ""
"Este campo es requerido para poder imprimir las facturas correctamente"

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_partner_id
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_afip_pos_partner_id
msgid "This is the address used for invoice reports of this POS"
msgstr ""
"Esta dirección es la usada para los reportes de facturación de este PdV"

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_number
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_afip_pos_number
msgid ""
"This is the point of sale number assigned by AFIP in order to generate "
Expand All @@ -1193,10 +1199,31 @@ msgid "Type of gross income: exempt, local, multilateral"
msgstr "Tipo de ingreso bruto: exento, local, multilateral"

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_share_sequences
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_share_sequences
msgid "Unified Book"
msgstr "Libro Unificado"

#. module: l10n_ar
#: model:product.product,uom_name:l10n_ar.product_product_arancel
#: model:product.product,uom_name:l10n_ar.product_product_cero
#: model:product.product,uom_name:l10n_ar.product_product_exento
#: model:product.product,uom_name:l10n_ar.product_product_no_gravado
#: model:product.product,uom_name:l10n_ar.product_product_quote_despacho
#: model:product.product,uom_name:l10n_ar.product_product_servicio_de_guarda
#: model:product.product,uom_name:l10n_ar.product_product_tasa_estadistica
#: model:product.product,uom_name:l10n_ar.product_product_telefonia
#: model:product.template,uom_name:l10n_ar.product_product_arancel_product_template
#: model:product.template,uom_name:l10n_ar.product_product_cero_product_template
#: model:product.template,uom_name:l10n_ar.product_product_exento_product_template
#: model:product.template,uom_name:l10n_ar.product_product_no_gravado_product_template
#: model:product.template,uom_name:l10n_ar.product_product_quote_despacho_product_template
#: model:product.template,uom_name:l10n_ar.product_product_servicio_de_guarda_product_template
#: model:product.template,uom_name:l10n_ar.product_product_tasa_estadistica_product_template
#: model:product.template,uom_name:l10n_ar.product_product_telefonia_product_template
msgid "Units"
msgstr "Unidades"

#. module: l10n_ar
#: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_vat_afip_code__1
msgid "Untaxed"
Expand All @@ -1214,6 +1241,7 @@ msgid "UpApP"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_share_sequences
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_share_sequences
msgid "Use same sequence for documents with the same letter"
msgstr "Usar la misma secuencia para documentos con misma letra"
Expand Down Expand Up @@ -1285,6 +1313,12 @@ msgstr "IVA No Gravado"
msgid "Warning"
msgstr "Alerta"

#. module: l10n_ar
#: code:addons/l10n_ar/models/res_partner.py:0
#, python-format
msgid "We were not able to sanitize the identification number"
msgstr "No pudimos limpiar el número de identificación"

#. module: l10n_ar
#: model_terms:ir.ui.view,arch_db:l10n_ar.view_account_invoice_report_search_inherit
msgid "With Document"
Expand Down
34 changes: 34 additions & 0 deletions addons/l10n_ar/i18n/l10n_ar.pot
Expand Up @@ -203,16 +203,19 @@ msgid "AFIP Concept"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_partner_id
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_partner_id
msgid "AFIP POS Address"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_number
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_number
msgid "AFIP POS Number"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_system
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_afip_pos_system
msgid "AFIP POS System"
msgstr ""
Expand Down Expand Up @@ -1007,6 +1010,7 @@ msgid "Sequence"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_sequence_ids
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_sequence_ids
msgid "Sequences"
msgstr ""
Expand Down Expand Up @@ -1120,11 +1124,13 @@ msgid "This field is required in order to print the invoice report properly"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_partner_id
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_afip_pos_partner_id
msgid "This is the address used for invoice reports of this POS"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_afip_pos_number
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_afip_pos_number
msgid ""
"This is the point of sale number assigned by AFIP in order to generate "
Expand All @@ -1143,10 +1149,31 @@ msgid "Type of gross income: exempt, local, multilateral"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,field_description:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_share_sequences
#: model:ir.model.fields,field_description:l10n_ar.field_account_journal__l10n_ar_share_sequences
msgid "Unified Book"
msgstr ""

#. module: l10n_ar
#: model:product.product,uom_name:l10n_ar.product_product_arancel
#: model:product.product,uom_name:l10n_ar.product_product_cero
#: model:product.product,uom_name:l10n_ar.product_product_exento
#: model:product.product,uom_name:l10n_ar.product_product_no_gravado
#: model:product.product,uom_name:l10n_ar.product_product_quote_despacho
#: model:product.product,uom_name:l10n_ar.product_product_servicio_de_guarda
#: model:product.product,uom_name:l10n_ar.product_product_tasa_estadistica
#: model:product.product,uom_name:l10n_ar.product_product_telefonia
#: model:product.template,uom_name:l10n_ar.product_product_arancel_product_template
#: model:product.template,uom_name:l10n_ar.product_product_cero_product_template
#: model:product.template,uom_name:l10n_ar.product_product_exento_product_template
#: model:product.template,uom_name:l10n_ar.product_product_no_gravado_product_template
#: model:product.template,uom_name:l10n_ar.product_product_quote_despacho_product_template
#: model:product.template,uom_name:l10n_ar.product_product_servicio_de_guarda_product_template
#: model:product.template,uom_name:l10n_ar.product_product_tasa_estadistica_product_template
#: model:product.template,uom_name:l10n_ar.product_product_telefonia_product_template
msgid "Units"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields.selection,name:l10n_ar.selection__account_tax_group__l10n_ar_vat_afip_code__1
msgid "Untaxed"
Expand All @@ -1164,6 +1191,7 @@ msgid "UpApP"
msgstr ""

#. module: l10n_ar
#: model:ir.model.fields,help:l10n_ar.field_account_bank_statement_import_journal_creation__l10n_ar_share_sequences
#: model:ir.model.fields,help:l10n_ar.field_account_journal__l10n_ar_share_sequences
msgid "Use same sequence for documents with the same letter"
msgstr ""
Expand Down Expand Up @@ -1235,6 +1263,12 @@ msgstr ""
msgid "Warning"
msgstr ""

#. module: l10n_ar
#: code:addons/l10n_ar/models/res_partner.py:0
#, python-format
msgid "We were not able to sanitize the identification number"
msgstr ""

#. module: l10n_ar
#: model_terms:ir.ui.view,arch_db:l10n_ar.view_account_invoice_report_search_inherit
msgid "With Document"
Expand Down
12 changes: 12 additions & 0 deletions addons/l10n_ar/models/res_partner.py
Expand Up @@ -2,6 +2,7 @@
from odoo import fields, models, api, _
from odoo.exceptions import UserError, ValidationError
import stdnum.ar
import re
import logging

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -110,3 +111,14 @@ def l10n_ar_identification_validation(self):
raise ValidationError(_('Only numbers allowed for "%s"') % rec.l10n_latam_identification_type_id.name)
except Exception as error:
raise ValidationError(repr(error))

@api.model
def _get_id_number_sanitize(self):
""" Sanitize the identification number. Return the digits/integer value of the identification number """
if self.l10n_latam_identification_type_id.l10n_ar_afip_code in ['80', '86']:
# Compact is the number clean up, remove all separators leave only digits
res = int(stdnum.ar.cuit.compact(self.vat))
else:
id_number = re.sub('[^0-9]', '', self.vat)
res = int(id_number)
return res
4 changes: 2 additions & 2 deletions addons/l10n_ar/views/report_invoice.xml
Expand Up @@ -87,7 +87,7 @@

<t t-set="custom_footer">
<div class="row">
<div name="footer_left_column" class="col-8 text-center">
<div name="footer_left_column" class="col-8 text-left">
</div>
<div name="footer_right_column" class="col-4 text-right">
<div name="pager" t-if="report_type == 'pdf'">
Expand Down Expand Up @@ -260,7 +260,7 @@

<t t-set="custom_footer">
<div class="row">
<div name="footer_left_column" class="col-8 text-center">
<div name="footer_left_column" class="col-8 text-left">
</div>
<div name="footer_right_column" class="col-4 text-right">
<div name="pager" t-if="report_type == 'pdf'">
Expand Down
3 changes: 1 addition & 2 deletions addons/l10n_cl/views/report_invoice.xml
Expand Up @@ -4,7 +4,6 @@
<!-- this header can be used on any Chilean report -->
<template id="custom_header">

<t t-set="report_date" t-value="o.invoice_date"/>
<t t-set="report_number" t-value="int(o.l10n_latam_document_number)"/>
<t t-set="pre_printed_report" t-value="report_type == 'pdf'"/>
<t t-set="report_name" t-value="o.l10n_latam_document_type_id.name"/>
Expand Down Expand Up @@ -83,7 +82,7 @@
<strong>
<span t-att-style="'color: %s;' % o.company_id.secondary_color">Date:</span>
</strong>
<span t-esc="report_date" t-options='{"widget": "date"}'/>
<span t-esc="o.invoice_date" t-options='{"widget": "date"}'/>
<br/>

<strong>Customer:</strong>
Expand Down
2 changes: 1 addition & 1 deletion addons/sale/wizard/sale_make_invoice_advance.py
Expand Up @@ -106,7 +106,7 @@ def _prepare_invoice_values(self, order, name, amount, so_line):
def _get_advance_details(self, order):
context = {'lang': order.partner_id.lang}
if self.advance_payment_method == 'percentage':
if self.product_id.taxes_id.price_include:
if all(self.product_id.taxes_id.mapped('price_include')):
amount = order.amount_total * self.amount / 100
else:
amount = order.amount_untaxed * self.amount / 100
Expand Down
2 changes: 1 addition & 1 deletion addons/sale_stock/tests/test_sale_stock.py
Expand Up @@ -128,7 +128,7 @@ def test_01_sale_stock_order(self):
})
act = adv_wiz.with_context(open_invoices=True).create_invoices()
inv = self.env['account.move'].browse(act['res_id'])
self.assertEqual(inv.amount_untaxed, self.so.amount_untaxed * 5.0 / 100.0, 'Sale Stock: deposit invoice is wrong')
self.assertEqual(inv.amount_total, self.so.amount_total * 5.0 / 100.0, 'Sale Stock: deposit invoice is wrong')
self.assertEqual(self.so.invoice_status, 'to invoice', 'Sale Stock: so should be to invoice after invoicing deposit')
# invoice on order: everything should be invoiced
self.so._create_invoices(final=True)
Expand Down
3 changes: 2 additions & 1 deletion debian/control
Expand Up @@ -29,6 +29,7 @@ Depends:
python3-lxml,
python3-mako,
python3-mock,
python3-ofxparse,
python3-passlib,
python3-polib,
python3-psutil,
Expand All @@ -39,13 +40,13 @@ Depends:
python3-qrcode,
python3-reportlab,
python3-requests,
python3-suds,
python3-tz,
python3-vatnumber,
python3-vobject,
python3-werkzeug,
python3-xlsxwriter,
python3-xlrd,
python3-zeep,
Conflicts: tinyerp-server, openerp-server, openerp-web, openerp
Replaces: tinyerp-server, openerp-server, openerp-web, openerp
Recommends:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -44,10 +44,10 @@ requires =
python3-requests
python3-six
python3-stdnum
python3-suds
python3-vatnumber
python3-vobject
python3-werkzeug
python3-xlwt
python3-xlrd
python3-zeep

2 changes: 1 addition & 1 deletion setup/package.dfdebian
Expand Up @@ -48,13 +48,13 @@ RUN apt-get update -qq && \
python3-reportlab \
python3-requests \
python3-serial \
python3-suds \
python3-tz \
python3-usb \
python3-vatnumber \
python3-vobject \
python3-werkzeug \
python3-xlsxwriter \
python3-zeep \
rsync && \
rm -rf /var/lib/apt/lists/*

Expand Down
5 changes: 3 additions & 2 deletions setup/package.dffedora
Expand Up @@ -33,20 +33,21 @@ RUN dnf update -d 0 -e 0 -y && \
python3-PyPDF2 \
python3-pyserial \
python3-dateutil \
python3-ofxparse \
python3-polib \
python3-pytz \
python3-pyusb \
python3-qrcode \
python3-reportlab \
python3-requests \
python3-six \
python3-suds \
python3-vatnumber \
python3-vobject \
python3-werkzeug \
python3-xlwt \
python3-xlrd \
python3-xlsxwriter \
python3-xlsxwriter \
python3-zeep \
libsass \
pytz \
postgresql \
Expand Down

0 comments on commit ca62572

Please sign in to comment.