Skip to content

Commit 9d0a40d

Browse files
[MIG] stock_account_operating_unit: Migration to 18.0
[FIX] ruff formatting [TEST] improve coverage [FIX] add missing exceptions import [TEST] improve valuation line coverage
1 parent 111deb8 commit 9d0a40d

13 files changed

Lines changed: 349 additions & 90 deletions

File tree

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.. image:: https://odoo-community.org/readme-banner-image
2-
:target: https://odoo-community.org/get-involved?utm_source=readme
3-
:alt: Odoo Community Association
4-
51
=======================================
62
Stock account moves with Operating Unit
73
=======================================
@@ -17,25 +13,25 @@ Stock account moves with Operating Unit
1713
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1814
:target: https://odoo-community.org/page/development-status
1915
:alt: Beta
20-
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
2117
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
2218
:alt: License: LGPL-3
2319
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github
24-
:target: https://github.com/OCA/operating-unit/tree/15.0/stock_account_operating_unit
20+
:target: https://github.com/OCA/operating-unit/tree/18.0/stock_account_operating_unit
2521
:alt: OCA/operating-unit
2622
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/operating-unit-15-0/operating-unit-15-0-stock_account_operating_unit
23+
:target: https://translation.odoo-community.org/projects/operating-unit-18-0/operating-unit-18-0-stock_account_operating_unit
2824
:alt: Translate me on Weblate
2925
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=15.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&target_branch=18.0
3127
:alt: Try me on Runboat
3228

3329
|badge1| |badge2| |badge3| |badge4| |badge5|
3430

3531
This module introduces the following features:
3632

37-
- Creates account move lines when stock moves are posted between internal
38-
locations within the same company, but different OU’s.
33+
- Creates account move lines when stock moves are posted between
34+
internal locations within the same company, but different OU’s.
3935

4036
**Table of contents**
4137

@@ -45,38 +41,38 @@ This module introduces the following features:
4541
Usage
4642
=====
4743

48-
Create stock moves between internal locations within the same company, but
49-
different OU’s. The journal entries are created and they are self-balanced
50-
within the OU when the journal entries are posted
44+
Create stock moves between internal locations within the same company,
45+
but different OU’s. The journal entries are created and they are
46+
self-balanced within the OU when the journal entries are posted
5147

5248
Bug Tracker
5349
===========
5450

5551
Bugs are tracked on `GitHub Issues <https://github.com/OCA/operating-unit/issues>`_.
5652
In case of trouble, please check there if your issue has already been reported.
5753
If you spotted it first, help us to smash it by providing a detailed and welcomed
58-
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20stock_account_operating_unit%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
`feedback <https://github.com/OCA/operating-unit/issues/new?body=module:%20stock_account_operating_unit%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5955

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

6258
Credits
6359
=======
6460

6561
Authors
66-
~~~~~~~
62+
-------
6763

6864
* ForgeFlow
6965
* Serpent Consulting Services Pvt. Ltd.
7066

7167
Contributors
72-
~~~~~~~~~~~~
68+
------------
7369

74-
* ForgeFlow, S.L. <contact@forgeflow.com>
75-
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
76-
* Jarsa Sistemas <info@jarsa.com.mx>
70+
- ForgeFlow, S.L. <contact@forgeflow.com>
71+
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
72+
- Jarsa Sistemas <info@jarsa.com.mx>
7773

7874
Maintainers
79-
~~~~~~~~~~~
75+
-----------
8076

8177
This module is maintained by the OCA.
8278

@@ -88,6 +84,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8884
mission is to support the collaborative development of Odoo features and
8985
promote its widespread use.
9086

91-
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/15.0/stock_account_operating_unit>`_ project on GitHub.
87+
This module is part of the `OCA/operating-unit <https://github.com/OCA/operating-unit/tree/18.0/stock_account_operating_unit>`_ project on GitHub.
9288

9389
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
2-
from . import model
2+
from . import models

stock_account_operating_unit/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"name": "Stock account moves with Operating Unit",
88
"summary": "Create journal entries in moves between internal locations "
99
"with different operating units.",
10-
"version": "15.0.1.0.0",
10+
"version": "18.0.1.0.0",
1111
"category": "Generic Modules/Sales & Purchases",
1212
"author": "ForgeFlow, "
1313
"Serpent Consulting Services Pvt. Ltd.,"
File renamed without changes.

stock_account_operating_unit/model/stock_move.py renamed to stock_account_operating_unit/models/stock_move.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ def _generate_valuation_lines_data(
1616
credit_value,
1717
debit_account_id,
1818
credit_account_id,
19+
svl_id,
1920
description,
2021
):
21-
res = super(StockMove, self)._generate_valuation_lines_data(
22+
res = super()._generate_valuation_lines_data(
2223
partner_id,
2324
qty,
2425
debit_value,
2526
credit_value,
2627
debit_account_id,
2728
credit_account_id,
29+
svl_id,
2830
description,
2931
)
3032
if res:
@@ -79,9 +81,8 @@ def _action_done(self, cancel_backorder=False):
7981
a transit location or is outside of the company or the source or
8082
destination locations belong to different operating units.
8183
"""
82-
res = super(StockMove, self)._action_done(cancel_backorder)
84+
res = super()._action_done(cancel_backorder)
8385
for move in self:
84-
8586
if move.product_id.valuation == "real_time":
8687
# Inter-operating unit moves do not accept to
8788
# from/to non-internal location
@@ -102,6 +103,7 @@ def _action_done(self, cancel_backorder=False):
102103
move.product_id.standard_price,
103104
acc_valuation,
104105
acc_valuation,
106+
False,
105107
_("%s - OU Move") % move.product_id.display_name,
106108
)
107109
am = (
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- ForgeFlow, S.L. \<contact@forgeflow.com\>
2+
- Serpent Consulting Services Pvt. Ltd. \<support@serpentcs.com\>
3+
- Jarsa Sistemas \<info@jarsa.com.mx\>

stock_account_operating_unit/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
This module introduces the following features:
22

3-
- Creates account move lines when stock moves are posted between internal
4-
locations within the same company, but different OU’s.
3+
- Creates account move lines when stock moves are posted between
4+
internal locations within the same company, but different OU’s.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Create stock moves between internal locations within the same company,
2+
but different OU’s. The journal entries are created and they are
3+
self-balanced within the OU when the journal entries are posted

0 commit comments

Comments
 (0)