Skip to content

Commit 35776c4

Browse files
[MIG] account_invoice_import: Backported to 13.0
1 parent 141632e commit 35776c4

File tree

12 files changed

+56
-67
lines changed

12 files changed

+56
-67
lines changed

account_invoice_import/README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Account Invoice Import
33
======================
44

5-
..
5+
..
66
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:26f0853d4122605d020e48687fa420f66fdad1a6c7e41efe74059e0a845f5348
10+
!! source digest: sha256:9ad4e4cf38e9978675644fa8918e5dc342177d73673e9e56d469daaafe5c0cda
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -120,6 +120,7 @@ Contributors
120120
* Yannick Vaucher <[email protected]>
121121
* Ronald Portier <[email protected]>
122122
* Simone Orsi <[email protected]>
123+
* Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>
123124

124125
Maintainers
125126
~~~~~~~~~~~
@@ -140,7 +141,7 @@ promote its widespread use.
140141

141142
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
142143

143-
|maintainer-alexis-via|
144+
|maintainer-alexis-via|
144145

145146
This module is part of the `OCA/edi <https://github.com/OCA/edi/tree/14.0/account_invoice_import>`_ project on GitHub.
146147

account_invoice_import/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Account Invoice Import",
7-
"version": "14.0.3.4.0",
7+
"version": "13.0.1.0.0",
88
"category": "Accounting & Finance",
99
"license": "AGPL-3",
1010
"summary": "Import supplier invoices/refunds as PDF or XML files",

account_invoice_import/models/res_partner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def _compute_invoice_import_count(self):
3434

3535
def show_account_invoice_import_config(self):
3636
self.ensure_one()
37-
xmlid = "account_invoice_import.account_invoice_import_config_action"
38-
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
37+
action = self.env["ir.actions.act_window"].for_xml_id(
38+
"account_invoice_import", "account_invoice_import_config_action"
39+
)
3940
action["context"] = {
4041
"default_name": self.name,
4142
"default_partner_id": self.id,

account_invoice_import/readme/CONTRIBUTORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
* Yannick Vaucher <[email protected]>
55
* Ronald Portier <[email protected]>
66
* Simone Orsi <[email protected]>
7+
* Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
22
access_account_invoice_import_config_read,Read access on account.invoice.import.config to Invoicing and Payment,model_account_invoice_import_config,account.group_account_invoice,1,0,0,0
3-
access_account_invoice_import_config_readonly_grp,Read access on account.invoice.import.config to Account Readonly grp,model_account_invoice_import_config,account.group_account_readonly,1,0,0,0
43
access_account_invoice_import_config_full,Full access on account.invoice.import.config to Account Manager,model_account_invoice_import_config,account.group_account_manager,1,1,1,1
5-
access_account_invoice_import,Access to account.invoice.import wizard,model_account_invoice_import,account.group_account_invoice,1,1,1,1

account_invoice_import/static/description/index.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
34
<head>
@@ -8,11 +9,10 @@
89

910
/*
1011
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12+
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
1213
:Copyright: This stylesheet has been placed in the public domain.
1314
1415
Default cascading style sheet for the HTML output of Docutils.
15-
Despite the name, some widely supported CSS2 features are used.
1616
1717
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1818
customize this style sheet.
@@ -275,7 +275,7 @@
275275
margin-left: 2em ;
276276
margin-right: 2em }
277277

278-
pre.code .ln { color: gray; } /* line numbers */
278+
pre.code .ln { color: grey; } /* line numbers */
279279
pre.code, code { background-color: #eeeeee }
280280
pre.code .comment, code .comment { color: #5C6576 }
281281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@
301301
span.pre {
302302
white-space: pre }
303303

304-
span.problematic, pre.problematic {
304+
span.problematic {
305305
color: red }
306306

307307
span.section-subtitle {
@@ -367,7 +367,7 @@ <h1 class="title">Account Invoice Import</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:26f0853d4122605d020e48687fa420f66fdad1a6c7e41efe74059e0a845f5348
370+
!! source digest: sha256:9ad4e4cf38e9978675644fa8918e5dc342177d73673e9e56d469daaafe5c0cda
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372372
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/edi/tree/14.0/account_invoice_import"><img alt="OCA/edi" src="https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/edi&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module has been started by lazy accounting users who hate enter they vendor bills manually in Odoo. Almost all companies have several vendor bills to enter regularly in the system from the same vendors: phone bill, electricity bill, Internet access, train tickets, etc. Most of these invoices are available as PDF. If we are able to automatically extract from the PDF the required information to enter the invoice as vendor bill in Odoo, then this module will create it automatically. To know the full story behind the development of this module, read this <a class="reference external" href="http://www.akretion.com/blog/akretions-christmas-present-for-the-odoo-community">blog post</a>.</p>
@@ -466,9 +466,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
466466
<div class="section" id="maintainers">
467467
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
468468
<p>This module is maintained by the OCA.</p>
469-
<a class="reference external image-reference" href="https://odoo-community.org">
470-
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
471-
</a>
469+
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
472470
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
473471
mission is to support the collaborative development of Odoo features and
474472
promote its widespread use.</p>

account_invoice_import/tests/test_invoice_import.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ def test_import_in_invoice(self):
216216
parsed_inv["invoice_number"] = "INV-%s" % import_c["invoice_line_method"]
217217
inv = (
218218
self.env["account.invoice.import"]
219-
.with_company(self.company.id)
219+
.with_context(company_id=self.company.id)
220220
.create_invoice(parsed_inv, import_c)
221221
)
222222
logger.debug("testing import with import config=%s", import_c)
223-
self.assertEqual(inv.move_type, parsed_inv["type"])
223+
self.assertEqual(inv.type, parsed_inv["type"])
224224
self.assertEqual(inv.company_id.id, self.company.id)
225225
self.assertFalse(
226226
inv.currency_id.compare_amounts(
@@ -278,11 +278,11 @@ def test_import_in_invoice_tax_include(self):
278278
parsed_inv["invoice_number"] = "INV-%s" % import_c["invoice_line_method"]
279279
inv = (
280280
self.env["account.invoice.import"]
281-
.with_company(self.company.id)
281+
.with_context(company_id=self.company.id)
282282
.create_invoice(parsed_inv, import_c)
283283
)
284284
logger.debug("testing import with import config=%s", import_c)
285-
self.assertEqual(inv.move_type, parsed_inv["type"])
285+
self.assertEqual(inv.type, parsed_inv["type"])
286286
self.assertEqual(inv.company_id.id, self.company.id)
287287
self.assertFalse(
288288
inv.currency_id.compare_amounts(
@@ -312,8 +312,7 @@ def test_import_out_invoice(self):
312312
"product": {"code": "AII-TEST-PRODUCT"},
313313
"name": "Super product",
314314
"qty": 3,
315-
"discount": 10,
316-
"price_unit": 100,
315+
"price_unit": 10.22,
317316
"date_start": "2017-08-01",
318317
"date_end": "2017-08-31",
319318
"taxes": [
@@ -332,13 +331,11 @@ def test_import_out_invoice(self):
332331
continue
333332
inv = (
334333
self.env["account.invoice.import"]
335-
.with_company(self.company.id)
334+
.with_context(company_id=self.company.id)
336335
.create_invoice(parsed_inv, import_config)
337336
)
338-
self.assertFalse(
339-
inv.currency_id.compare_amounts(inv.amount_untaxed, 270.00)
340-
)
341-
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_total, 272.70))
337+
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_untaxed, 30.66))
338+
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_total, 30.97))
342339
self.assertEqual(
343340
fields.Date.to_string(inv.invoice_date), parsed_inv["date"]
344341
)
@@ -444,7 +441,7 @@ def test_email_no_partner_match(self):
444441
move = self.env["account.move"].search(
445442
[
446443
("company_id", "=", self.company.id),
447-
("move_type", "=", "in_invoice"),
444+
("type", "=", "in_invoice"),
448445
("invoice_source_email", "like", sender_email),
449446
("state", "=", "draft"),
450447
]
@@ -461,7 +458,7 @@ def test_email_partner_no_invoice_config(self):
461458
move = self.env["account.move"].search(
462459
[
463460
("company_id", "=", self.company.id),
464-
("move_type", "=", "in_invoice"),
461+
("type", "=", "in_invoice"),
465462
("partner_id", "=", self.partner_with_email.id),
466463
("state", "=", "draft"),
467464
]
@@ -479,7 +476,7 @@ def test_email_partner_invoice_config(self):
479476
move = self.env["account.move"].search(
480477
[
481478
("company_id", "=", self.company.id),
482-
("move_type", "=", "in_invoice"),
479+
("type", "=", "in_invoice"),
483480
("partner_id", "=", partner.id),
484481
("state", "=", "draft"),
485482
]

account_invoice_import/views/account_invoice.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
name="%(account_invoice_import_action)d"
1616
string="Import Invoice File"
1717
context="{'wizard_default_state': 'update-from-invoice', 'default_invoice_id': id, 'default_partner_id': commercial_partner_id}"
18-
attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund')), ('state', '!=', 'draft')]}"
18+
attrs="{'invisible': ['|', ('type', 'not in', ('in_invoice', 'in_refund')), ('state', '!=', 'draft')]}"
1919
/>
2020
<!-- Button for quick access to the wizard
2121
to encode multiple invoices -->
@@ -24,7 +24,7 @@
2424
name="%(account_invoice_import_action)d"
2525
string="Import Next Invoice"
2626
context="{}"
27-
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}"
27+
attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"
2828
/>
2929
</button>
3030
</field>

account_invoice_import/views/account_journal_dashboard.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
1111
<field name="arch" type="xml">
1212
<button
13-
class="btn btn-primary o_button_upload_bill oe_kanban_action_button"
13+
class="btn btn-primary o_button_upload_bill"
1414
journal_type="purchase"
1515
position="attributes"
1616
>

account_invoice_import/views/res_partner.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
<record id="view_partner_property_form" model="ir.ui.view">
99
<field name="model">res.partner</field>
1010
<field name="inherit_id" ref="account.view_partner_property_form" />
11-
<field
12-
name="groups_id"
13-
eval="[(4, ref('account.group_account_invoice')), (4, ref('account.group_account_readonly'))]"
14-
/>
11+
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
1512
<field name="arch" type="xml">
1613
<button
1714
name="%(base.action_res_partner_bank_account_form)d"

0 commit comments

Comments
 (0)