Skip to content

Commit

Permalink
[3422][ADD] stock_lot_price_unit, mrp_subcontracting_lot_price_unit (#29
Browse files Browse the repository at this point in the history
)

* [3422][ADD] stock_lot_price_unit
  • Loading branch information
yostashiro authored Jun 20, 2023
1 parent 23630b1 commit f803a51
Show file tree
Hide file tree
Showing 26 changed files with 1,229 additions and 0 deletions.
54 changes: 54 additions & 0 deletions mrp_subcontracting_lot_price_unit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
=================================
MRP Subcontracting Lot Price Unit
=================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-qrtl%2Faxls--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/axls-custom/tree/16.0/mrp_subcontracting_lot_price_unit
:alt: qrtl/axls-custom

|badge1| |badge2| |badge3|

This module makes necessary adjustments to the behavior of stock_lot_price_unit module.
Without this module, lot unit price would not consider the component costs of production
in subcontracting scenarios.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/axls-custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/qrtl/axls-custom/issues/new?body=module:%20mrp_subcontracting_lot_price_unit%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

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

This module is part of the `qrtl/axls-custom <https://github.com/qrtl/axls-custom/tree/16.0/mrp_subcontracting_lot_price_unit>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions mrp_subcontracting_lot_price_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions mrp_subcontracting_lot_price_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Quartile Limited (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "MRP Subcontracting Lot Price Unit",
"version": "16.0.1.0.0",
"author": "Quartile Limited",
"website": "https://www.quartile.co",
"category": "Warehouse Management",
"license": "AGPL-3",
"depends": ["mrp_subcontracting", "stock_lot_price_unit"],
"installable": True,
"auto_install": True,
}
21 changes: 21 additions & 0 deletions mrp_subcontracting_lot_price_unit/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_subcontracting_lot_price_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-19 06:02+0000\n"
"PO-Revision-Date: 2023-06-19 06:02+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: mrp_subcontracting_lot_price_unit
#: model:ir.model,name:mrp_subcontracting_lot_price_unit.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr "製品の移動(在庫移動ライン)"
1 change: 1 addition & 0 deletions mrp_subcontracting_lot_price_unit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move_line
21 changes: 21 additions & 0 deletions mrp_subcontracting_lot_price_unit/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 Quartile Limited (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import models


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

def _skip_lot_price_unit_update(self):
"""Skip updating the price unit of the lot for subcontracting receipt moves, as
price_unit of these records does not reflect the component costs, whereas that
of the finished product receipt in the subcontracting manufacting order does.
By skipping the the subcontracting receipt move, price_unit of the lot
effectively takes the value from the the finished product receipt in the
subcontracting manufacting order.
"""
res = super()._skip_lot_price_unit_update()
if res and self.move_id.is_subcontract:
return True
return False
3 changes: 3 additions & 0 deletions mrp_subcontracting_lot_price_unit/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module makes necessary adjustments to the behavior of stock_lot_price_unit module.
Without this module, lot unit price would not consider the component costs of production
in subcontracting scenarios.
Loading

0 comments on commit f803a51

Please sign in to comment.