Skip to content

Commit

Permalink
[4334][ADD] stock_account_owner_valued
Browse files Browse the repository at this point in the history
  • Loading branch information
yostashiro authored and kanda999 committed Apr 1, 2024
1 parent 6d58caf commit ce65f77
Show file tree
Hide file tree
Showing 16 changed files with 673 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_account_owner_valued/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
78 changes: 78 additions & 0 deletions stock_account_owner_valued/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
==========================
Stock Account Owner Valued
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:296912c04b1ac01550f2d061d609e0fae9a481213f25fe36f3a289730cade3f4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_account_owner_valued
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_account_owner_valued
: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/stock-logistics-workflow&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module enables inventory valuation for owners whose value_owner_inventory is set to True.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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/stock-logistics-workflow/issues/new?body=module:%20stock_account_owner_valued%0Aversion:%2016.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.

Credits
=======

Authors
~~~~~~~

* Quartile Limited

Contributors
~~~~~~~~~~~~

* `Quartile <https://www.quartile.co>`__:

* Aung Ko Ko Lin

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_account_owner_valued>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions stock_account_owner_valued/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions stock_account_owner_valued/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Stock Account Owner Valued",
"version": "16.0.1.0.0",
"author": "Quartile Limited, Odoo Community Association (OCA)",
"category": "Stock",
"depends": ["stock_account"],
"website": "https://github.com/OCA/stock-logistics-workflow",
"data": [
"views/res_partner_views.xml",
],
"installable": True,
"auto_install": False,
"license": "AGPL-3",
}
4 changes: 4 additions & 0 deletions stock_account_owner_valued/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import res_partner
from . import stock_move
from . import stock_move_line
from . import stock_quant
12 changes: 12 additions & 0 deletions stock_account_owner_valued/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

value_owner_inventory = fields.Boolean(
help="If enabled, the inventory valuation will be calculated for this partner."
)
14 changes: 14 additions & 0 deletions stock_account_owner_valued/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockMove(models.Model):
_inherit = "stock.move"

def _should_exclude_for_valuation(self):
self.ensure_one()
if self.restrict_partner_id.value_owner_inventory:
return False
return super()._should_exclude_for_valuation()
14 changes: 14 additions & 0 deletions stock_account_owner_valued/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

def _should_exclude_for_valuation(self):
self.ensure_one()
if self.owner_id.value_owner_inventory:
return False
return super()._should_exclude_for_valuation()
14 changes: 14 additions & 0 deletions stock_account_owner_valued/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockQuant(models.Model):
_inherit = "stock.quant"

def _should_exclude_for_valuation(self):
self.ensure_one()
if self.owner_id.value_owner_inventory:
return False
return super()._should_exclude_for_valuation()
3 changes: 3 additions & 0 deletions stock_account_owner_valued/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Quartile <https://www.quartile.co>`__:

* Aung Ko Ko Lin
1 change: 1 addition & 0 deletions stock_account_owner_valued/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module enables inventory valuation for owners whose value_owner_inventory is set to True.
Loading

0 comments on commit ce65f77

Please sign in to comment.