Skip to content

Commit

Permalink
[MIG] pos_analytic_by_config: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Nov 20, 2024
1 parent 0949d6f commit 9a079b5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pos_analytic_by_config/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ POS Analytic Config
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github
:target: https://github.com/OCA/account-analytic/tree/17.0/pos_analytic_by_config
:target: https://github.com/OCA/account-analytic/tree/18.0/pos_analytic_by_config
:alt: OCA/account-analytic
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-pos_analytic_by_config
:target: https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-pos_analytic_by_config
: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/account-analytic&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-analytic&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -69,7 +69,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-analytic/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/account-analytic/issues/new?body=module:%20pos_analytic_by_config%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-analytic/issues/new?body=module:%20pos_analytic_by_config%0Aversion:%2018.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 @@ -112,6 +112,6 @@ 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.

This module is part of the `OCA/account-analytic <https://github.com/OCA/account-analytic/tree/17.0/pos_analytic_by_config>`_ project on GitHub.
This module is part of the `OCA/account-analytic <https://github.com/OCA/account-analytic/tree/18.0/pos_analytic_by_config>`_ 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 pos_analytic_by_config/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "ACSONE SA/NV, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-analytic",
"category": "Point Of Sale, Accounting",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["point_of_sale"],
"data": [
Expand Down
6 changes: 3 additions & 3 deletions pos_analytic_by_config/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">POS Analytic Config</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2f84d31df29ec4fe16b6edf8fef7c20679377c5798656455ce2540aa48f0b176
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/account-analytic/tree/17.0/pos_analytic_by_config"><img alt="OCA/account-analytic" src="https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-analytic-17-0/account-analytic-17-0-pos_analytic_by_config"><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/account-analytic&amp;target_branch=17.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/account-analytic/tree/18.0/pos_analytic_by_config"><img alt="OCA/account-analytic" src="https://img.shields.io/badge/github-OCA%2Faccount--analytic-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-analytic-18-0/account-analytic-18-0-pos_analytic_by_config"><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/account-analytic&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to generate analytic distributions from the PoS
orders.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -419,7 +419,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-analytic/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/account-analytic/issues/new?body=module:%20pos_analytic_by_config%0Aversion:%2017.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/account-analytic/issues/new?body=module:%20pos_analytic_by_config%0Aversion:%2018.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 @@ -459,7 +459,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<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>This module is part of the <a class="reference external" href="https://github.com/OCA/account-analytic/tree/17.0/pos_analytic_by_config">OCA/account-analytic</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-analytic/tree/18.0/pos_analytic_by_config">OCA/account-analytic</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
18 changes: 14 additions & 4 deletions pos_analytic_by_config/tests/test_pos_analytic_by_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2015 ACSONE SA/NV
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import json

from odoo.tests import tagged

from odoo.addons.point_of_sale.tests.common import TestPointOfSaleCommon, TestPoSCommon
Expand Down Expand Up @@ -46,8 +48,8 @@ def setUpClass(cls):

def _create_order(self):
order_data = self.create_ui_order_data([(self.product_a, 1)])
order = self.env["pos.order"].create_from_ui([order_data])
self.pos_order = self.env["pos.order"].browse(order[0]["id"])
order = self.env["pos.order"].sync_from_ui([order_data])
self.pos_order = self.env["pos.order"].browse(int(order["pos.order"][0]["id"]))

def _close_session(self, amount_paid):
self.session.post_closing_cash_details(amount_paid)
Expand All @@ -58,7 +60,11 @@ def test_order_simple_receipt(self):
self._create_order()
aml_domain = [
("account_id", "=", self.sales_account.id),
("analytic_distribution", "=", {f"{self.analytic_account.id}": 100.0}),
(
"analytic_distribution",
"=",
json.dumps({str(self.analytic_account.id): 100.0}),
),
]
# There aren't lines with the analytic account yet
self.assertFalse(self.env["account.move.line"].search(aml_domain))
Expand All @@ -73,7 +79,11 @@ def test_order_invoice(self):
aml_domain = [
("account_id", "=", self.sales_account.id),
("product_id", "=", self.product_a.id),
("analytic_distribution", "=", {f"{self.analytic_account.id}": 100.0}),
(
"analytic_distribution",
"=",
json.dumps({str(self.analytic_account.id): 100.0}),
),
]
lines = self.env["account.move.line"].search(aml_domain)
# There aren't lines with the analytic account yet
Expand Down

0 comments on commit 9a079b5

Please sign in to comment.