Skip to content

Commit

Permalink
[MIG] account_invoice_import: Backported to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeliconiaSolutions committed Dec 9, 2024
1 parent 141632e commit 9406e9e
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 62 deletions.
7 changes: 4 additions & 3 deletions account_invoice_import/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Account Invoice Import
======================

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:26f0853d4122605d020e48687fa420f66fdad1a6c7e41efe74059e0a845f5348
!! source digest: sha256:9ad4e4cf38e9978675644fa8918e5dc342177d73673e9e56d469daaafe5c0cda
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -120,6 +120,7 @@ Contributors
* Yannick Vaucher <[email protected]>
* Ronald Portier <[email protected]>
* Simone Orsi <[email protected]>
* Heliconia Solutions <[email protected]>

Maintainers
~~~~~~~~~~~
Expand All @@ -140,7 +141,7 @@ promote its widespread use.

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

|maintainer-alexis-via|
|maintainer-alexis-via|

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

Expand Down
2 changes: 1 addition & 1 deletion account_invoice_import/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Account Invoice Import",
"version": "14.0.3.4.0",
"version": "13.0.1.0.0",
"category": "Accounting & Finance",
"license": "AGPL-3",
"summary": "Import supplier invoices/refunds as PDF or XML files",
Expand Down
5 changes: 3 additions & 2 deletions account_invoice_import/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def _compute_invoice_import_count(self):

def show_account_invoice_import_config(self):
self.ensure_one()
xmlid = "account_invoice_import.account_invoice_import_config_action"
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account_invoice_import", "account_invoice_import_config_action"
)
action["context"] = {
"default_name": self.name,
"default_partner_id": self.id,
Expand Down
1 change: 1 addition & 0 deletions account_invoice_import/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* Yannick Vaucher <[email protected]>
* Ronald Portier <[email protected]>
* Simone Orsi <[email protected]>
* Heliconia Solutions <[email protected]>
2 changes: 0 additions & 2 deletions account_invoice_import/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
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
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
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
access_account_invoice_import,Access to account.invoice.import wizard,model_account_invoice_import,account.group_account_invoice,1,1,1,1
14 changes: 6 additions & 8 deletions account_invoice_import/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -8,11 +9,10 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

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

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Account Invoice Import</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:26f0853d4122605d020e48687fa420f66fdad1a6c7e41efe74059e0a845f5348
!! source digest: sha256:9ad4e4cf38e9978675644fa8918e5dc342177d73673e9e56d469daaafe5c0cda
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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>
<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>
Expand Down Expand Up @@ -466,9 +466,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
19 changes: 8 additions & 11 deletions account_invoice_import/tests/test_invoice_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_import_in_invoice(self):
.create_invoice(parsed_inv, import_c)
)
logger.debug("testing import with import config=%s", import_c)
self.assertEqual(inv.move_type, parsed_inv["type"])
self.assertEqual(inv.type, parsed_inv["type"])
self.assertEqual(inv.company_id.id, self.company.id)
self.assertFalse(
inv.currency_id.compare_amounts(
Expand Down Expand Up @@ -282,7 +282,7 @@ def test_import_in_invoice_tax_include(self):
.create_invoice(parsed_inv, import_c)
)
logger.debug("testing import with import config=%s", import_c)
self.assertEqual(inv.move_type, parsed_inv["type"])
self.assertEqual(inv.type, parsed_inv["type"])
self.assertEqual(inv.company_id.id, self.company.id)
self.assertFalse(
inv.currency_id.compare_amounts(
Expand Down Expand Up @@ -312,8 +312,7 @@ def test_import_out_invoice(self):
"product": {"code": "AII-TEST-PRODUCT"},
"name": "Super product",
"qty": 3,
"discount": 10,
"price_unit": 100,
"price_unit": 10.22,
"date_start": "2017-08-01",
"date_end": "2017-08-31",
"taxes": [
Expand All @@ -335,10 +334,8 @@ def test_import_out_invoice(self):
.with_company(self.company.id)
.create_invoice(parsed_inv, import_config)
)
self.assertFalse(
inv.currency_id.compare_amounts(inv.amount_untaxed, 270.00)
)
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_total, 272.70))
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_untaxed, 30.66))
self.assertFalse(inv.currency_id.compare_amounts(inv.amount_total, 30.97))
self.assertEqual(
fields.Date.to_string(inv.invoice_date), parsed_inv["date"]
)
Expand Down Expand Up @@ -444,7 +441,7 @@ def test_email_no_partner_match(self):
move = self.env["account.move"].search(
[
("company_id", "=", self.company.id),
("move_type", "=", "in_invoice"),
("type", "=", "in_invoice"),
("invoice_source_email", "like", sender_email),
("state", "=", "draft"),
]
Expand All @@ -461,7 +458,7 @@ def test_email_partner_no_invoice_config(self):
move = self.env["account.move"].search(
[
("company_id", "=", self.company.id),
("move_type", "=", "in_invoice"),
("type", "=", "in_invoice"),
("partner_id", "=", self.partner_with_email.id),
("state", "=", "draft"),
]
Expand All @@ -479,7 +476,7 @@ def test_email_partner_invoice_config(self):
move = self.env["account.move"].search(
[
("company_id", "=", self.company.id),
("move_type", "=", "in_invoice"),
("type", "=", "in_invoice"),
("partner_id", "=", partner.id),
("state", "=", "draft"),
]
Expand Down
4 changes: 2 additions & 2 deletions account_invoice_import/views/account_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name="%(account_invoice_import_action)d"
string="Import Invoice File"
context="{'wizard_default_state': 'update-from-invoice', 'default_invoice_id': id, 'default_partner_id': commercial_partner_id}"
attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund')), ('state', '!=', 'draft')]}"
attrs="{'invisible': ['|', ('type', 'not in', ('in_invoice', 'in_refund')), ('state', '!=', 'draft')]}"
/>
<!-- Button for quick access to the wizard
to encode multiple invoices -->
Expand All @@ -24,7 +24,7 @@
name="%(account_invoice_import_action)d"
string="Import Next Invoice"
context="{}"
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}"
attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"
/>
</button>
</field>
Expand Down
2 changes: 1 addition & 1 deletion account_invoice_import/views/account_journal_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
<field name="arch" type="xml">
<button
class="btn btn-primary o_button_upload_bill oe_kanban_action_button"
class="btn btn-primary o_button_upload_bill"
journal_type="purchase"
position="attributes"
>
Expand Down
5 changes: 1 addition & 4 deletions account_invoice_import/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
<record id="view_partner_property_form" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form" />
<field
name="groups_id"
eval="[(4, ref('account.group_account_invoice')), (4, ref('account.group_account_readonly'))]"
/>
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<button
name="%(base.action_res_partner_bank_account_form)d"
Expand Down
Loading

0 comments on commit 9406e9e

Please sign in to comment.