Skip to content

Commit

Permalink
[MIG][15.0] account_invoice_consolidated:Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzappdev committed Oct 1, 2024
1 parent abb6028 commit 6ba0ded
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 86 deletions.
10 changes: 5 additions & 5 deletions account_invoice_consolidated/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Account Invoice Consolidated
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmulti--company-lightgray.png?logo=github
:target: https://github.com/OCA/multi-company/tree/14.0/account_invoice_consolidated
:target: https://github.com/OCA/multi-company/tree/15.0/account_invoice_consolidated
:alt: OCA/multi-company
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/multi-company-14-0/multi-company-14-0-account_invoice_consolidated
:target: https://translation.odoo-community.org/projects/multi-company-15-0/multi-company-15-0-account_invoice_consolidated
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/multi-company&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/multi-company&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -154,7 +154,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/multi-company/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/multi-company/issues/new?body=module:%20account_invoice_consolidated%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/multi-company/issues/new?body=module:%20account_invoice_consolidated%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -206,6 +206,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-max3903| |maintainer-swapnesh-serpentcs|

This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/14.0/account_invoice_consolidated>`_ project on GitHub.
This module is part of the `OCA/multi-company <https://github.com/OCA/multi-company/tree/15.0/account_invoice_consolidated>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_invoice_consolidated/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Account Invoice Consolidated",
"version": "14.0.1.0.4",
"version": "15.0.1.0.0",
"summary": "Consolidate your invoices across companies",
"author": "Open Source Integrators, "
"Serpent Consulting Services Pvt. Ltd., "
Expand Down
34 changes: 0 additions & 34 deletions account_invoice_consolidated/migrations/14.0.1.0.1/post-migrate.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def compute_amount(self):
)

invoice_line_ids = fields.One2many(
"account.move.line", "consolidated_by_id", string="Invoice Line Ids"
"account.move.line",
"consolidated_by_id",
)

@api.constrains("name")
Expand Down Expand Up @@ -210,10 +211,8 @@ def action_confirm_invoice(self):
or not company.due_fromto_payment_journal_id
):
raise ValidationError(
_(
"Intercompany Payment Configuration is missing for"
" %s." % (company.display_name)
)
_("Intercompany Payment Configuration is missing for" " %s.")
% (company.display_name)
)
invoice_consolidated_seq = self.env["ir.sequence"].next_by_code(
"consolidated.invoice"
Expand Down Expand Up @@ -318,11 +317,12 @@ def prepare_payment_values(self, invoice):
"amount": invoice.amount_residual,
"journal_id": journal_id.id,
"payment_type": "inbound",
"payment_method_id": journal_id.inbound_payment_method_ids[0].id,
"payment_method_line_id": journal_id.inbound_payment_method_line_ids[0].id,
"date": fields.Datetime.now(),
"consolidation_id": self.id,
"company_id": invoice.company_id.id,
"reconciled_invoice_ids": [(4, invoice.id, None)],
"move_type": "entry",
}

return res
18 changes: 10 additions & 8 deletions account_invoice_consolidated/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?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 @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z 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: grey; } /* line numbers */
pre.code .ln { color: gray; } /* 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 {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Account Invoice Consolidated</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9d95d648546d3f42006042ffab11fb95a6eb7a4c0df95db72ca0c8e49d2a4912
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/multi-company/tree/14.0/account_invoice_consolidated"><img alt="OCA/multi-company" src="https://img.shields.io/badge/github-OCA%2Fmulti--company-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/multi-company-14-0/multi-company-14-0-account_invoice_consolidated"><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/multi-company&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><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/multi-company/tree/15.0/account_invoice_consolidated"><img alt="OCA/multi-company" src="https://img.shields.io/badge/github-OCA%2Fmulti--company-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/multi-company-15-0/multi-company-15-0-account_invoice_consolidated"><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/multi-company&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows organizations with multiples companies to transfer the
liability of a customer to another company and provide the customer with a
unique consolidated invoice to pay.</p>
Expand Down Expand Up @@ -641,7 +641,7 @@ <h3><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h3>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/multi-company/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/multi-company/issues/new?body=module:%20account_invoice_consolidated%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/multi-company/issues/new?body=module:%20account_invoice_consolidated%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -673,13 +673,15 @@ <h4><a class="toc-backref" href="#toc-entry-7">Other credits</a></h4>
<div class="section" id="maintainers">
<h4><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h4>
<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>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/swapnesh-serpentcs"><img alt="swapnesh-serpentcs" src="https://github.com/swapnesh-serpentcs.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/multi-company/tree/14.0/account_invoice_consolidated">OCA/multi-company</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/multi-company/tree/15.0/account_invoice_consolidated">OCA/multi-company</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
27 changes: 11 additions & 16 deletions account_invoice_consolidated/tests/test_consolidated_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from odoo import _
from odoo.exceptions import ValidationError
from odoo.modules.module import get_resource_path
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.tools import convert_file


class TestConsolidatedInvoice(SavepointCase):
class TestConsolidatedInvoice(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestConsolidatedInvoice, cls).setUpClass()
Expand Down Expand Up @@ -92,16 +92,12 @@ def setUpClass(cls):
cls.env.user.company_id = cls.company_a

cls.company_a.due_fromto_payment_journal_id = cls.env.ref(
"account_invoice_consolidated.sales_journal_company_a"
"account_invoice_consolidated.bank_journal_company_a"
)
cls.company_b.due_fromto_payment_journal_id = cls.env.ref(
"account_invoice_consolidated.bank_journal_company_b"
)

cls.company_b.due_fromto_payment_journal_id.payment_debit_account_id = (
cls.env.ref("account_invoice_consolidated.a_expense_company_b")
)

cls.company_a.due_from_account_id = cls.env.ref(
"account_invoice_consolidated.a_pay_company_a"
)
Expand Down Expand Up @@ -178,15 +174,14 @@ def test_consolidated_invoice(self):
inv.update(vals)

with self.assertRaises(ValidationError):
self.consolidated_inv_obj.create(
{
"company_id": self.company_a.id,
"date_from": datetime.today() + relativedelta(months=-6),
"date_to": datetime.today(),
"partner_id": self.partner_user.id,
}
)

vals = {
"company_id": self.company_a.id,
"date_from": datetime.today() + relativedelta(months=-6),
"date_to": datetime.today(),
"partner_id": self.partner_user.id,
}
self.consolidated_inv_obj.create(vals)
self.consolidated_inv_obj.create(vals)
with self.assertRaises(ValidationError):
inv.sudo().unlink()
inv.sudo().write({"state": "draft"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@
<field name="code">SAJ-A</field>
<field name="type">sale</field>
<field name="secure_sequence_id" ref="sequence_sale_journal_company_a" />
<field name="payment_credit_account_id" ref="a_sale_company_a" />
<field name="payment_debit_account_id" ref="a_sale_company_a" />
<field
name="inbound_payment_method_ids"
name="inbound_payment_method_line_ids"
eval="[(6, 0, [ref('account.account_payment_method_manual_in')])]"
/>
<!-- <field name="update_posted" eval="True"/>
Expand All @@ -231,9 +229,7 @@
<field name="code">SAJ-B</field>
<field name="type">sale</field>
<field name="secure_sequence_id" ref="sequence_sale_journal_company_b" />
<field name="payment_credit_account_id" ref="a_sale_company_b" />
<field name="payment_debit_account_id" ref="a_sale_company_b" />
<!-- <field name="update_posted" eval="True"/>
<!-- <field name="update_posted" eval="True"/>
--> <field
name="company_id"
ref="company_b"
Expand All @@ -244,8 +240,6 @@
<field name="name">Bank Journal - (Company A)</field>
<field name="code">BNK-A</field>
<field name="type">bank</field>
<field name="payment_credit_account_id" ref="a_sale_company_a" />
<field name="payment_debit_account_id" ref="a_sale_company_a" />
<field name="company_id" ref="company_a" />
</record>

Expand All @@ -254,9 +248,7 @@
<field name="code">EXJ-B</field>
<field name="type">purchase</field>
<field name="secure_sequence_id" ref="sequence_purchase_journal_company_b" />
<field name="payment_credit_account_id" ref="a_expense_company_b" />
<field name="payment_debit_account_id" ref="a_expense_company_b" />
<!-- <field name="update_posted" eval="True"/>
<!-- <field name="update_posted" eval="True"/>
--> <field
name="company_id"
ref="company_b"
Expand All @@ -267,10 +259,8 @@
<field name="name">Bank Journal - (Company B)</field>
<field name="code">BNK-B</field>
<field name="type">bank</field>
<field name="payment_credit_account_id" ref="a_sale_company_b" />
<field name="payment_debit_account_id" ref="a_sale_company_b" />
<field
name="inbound_payment_method_ids"
name="inbound_payment_method_line_ids"
eval="[(6, 0, [ref('account.account_payment_method_manual_in')])]"
/>
<field name="company_id" ref="company_b" />
Expand Down Expand Up @@ -415,6 +405,20 @@
<field name="company_id" ref="" />
</record>

<record id="company_a" model="res.company">
<field name="account_journal_payment_credit_account_id" ref="a_sale_company_a" />
<field name="account_journal_payment_debit_account_id" ref="a_sale_company_a" />
</record>
<record id="company_b" model="res.company">
<field
name="account_journal_payment_credit_account_id"
ref="a_expense_company_b"
/>
<field
name="account_journal_payment_debit_account_id"
ref="a_expense_company_b"
/>
</record>
<!--
Create draft invoice
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@
</div>
</div>
<div class="col-6">
<div class="row">
<div class="row d-block">
<div class="d-inline">
<p style="color: #924eb9">CONTACT US:
<p
class="d-inline"
style="color: #924eb9;"
>CONTACT US:
<span
t-field="company.partner_id.phone"
style="color: #000; font-weight: bold;"
Expand Down

0 comments on commit 6ba0ded

Please sign in to comment.