-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3533][ADD] stock_move_ignore_last_purchase_date (#35)
* [ADD] stock_move_ignore_purchase_last_date
- Loading branch information
1 parent
2f82921
commit b25864b
Showing
15 changed files
with
634 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
setup/stock_move_ignore_last_purchase_date/odoo/addons/stock_move_ignore_last_purchase_date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_move_ignore_last_purchase_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
==================================== | ||
Stock Move Ingore Last Purchase Date | ||
==================================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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/stock_move_ignore_last_purchase_date | ||
:alt: qrtl/axls-custom | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
This module adds the *Ignore Last Purchase Date* field to the stock move to adjust | ||
assigning to last_purchase_date of product. | ||
|
||
Background | ||
~~~~~~~~~~ | ||
|
||
Certain receipts might be validated later than their actual reception date. | ||
Therefore, the "last purchase date" should not always correspond to the validation date. | ||
In such cases, instead of assigning the validation date to the "last purchase date", | ||
the "man last purchase date" should be used instead. | ||
|
||
**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:%20stock_move_ignore_last_purchase_date%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/stock_move_ignore_last_purchase_date>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Stock Move Ingore Last Purchase Date", | ||
"version": "16.0.1.0.0", | ||
"author": "Quartile Limited", | ||
"website": "https://www.quartile.co", | ||
"category": "Product", | ||
"license": "AGPL-3", | ||
"depends": ["product_last_purchase_date"], | ||
"data": [ | ||
"views/stock_picking_views.xml", | ||
"views/stock_move_views.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_move_ignore_last_purchase_date | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-07-12 05:42+0000\n" | ||
"PO-Revision-Date: 2023-07-12 05:42+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: stock_move_ignore_last_purchase_date | ||
#: model:ir.model.fields,field_description:stock_move_ignore_last_purchase_date.field_stock_move__ignore_last_purchase_date | ||
#: model:ir.model.fields,field_description:stock_move_ignore_last_purchase_date.field_stock_picking__ignore_last_purchase_date | ||
msgid "Ignore Last Purchase Date" | ||
msgstr "最終購入日計算で無視" | ||
|
||
#. module: stock_move_ignore_last_purchase_date | ||
#: model:ir.model.fields,help:stock_move_ignore_last_purchase_date.field_stock_move__ignore_last_purchase_date | ||
msgid "Ignore assigning last purchase date" | ||
msgstr "最終購入日計算で無視" | ||
|
||
#. module: stock_move_ignore_last_purchase_date | ||
#: model:ir.model,name:stock_move_ignore_last_purchase_date.model_product_product | ||
msgid "Product Variant" | ||
msgstr "プロダクトバリアント" | ||
|
||
#. module: stock_move_ignore_last_purchase_date | ||
#: model:ir.model,name:stock_move_ignore_last_purchase_date.model_stock_move | ||
msgid "Stock Move" | ||
msgstr "在庫移動" | ||
|
||
#. module: stock_move_ignore_last_purchase_date | ||
#: model:ir.model,name:stock_move_ignore_last_purchase_date.model_stock_picking | ||
msgid "Transfer" | ||
msgstr "運送" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import stock_move | ||
from . import stock_picking | ||
from . import product_product |
14 changes: 14 additions & 0 deletions
14
stock_move_ignore_last_purchase_date/models/product_product.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
from odoo.osv import expression | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
def _get_move_domain(self, product): | ||
domain = super()._get_move_domain(product) | ||
domain = expression.AND([domain, [("ignore_last_purchase_date", "=", False)]]) | ||
return domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
ignore_last_purchase_date = fields.Boolean( | ||
compute="_compute_ignore_last_purchase_date", | ||
store=True, | ||
help="Ignore assigning last purchase date", | ||
) | ||
|
||
@api.depends("picking_id.ignore_last_purchase_date") | ||
def _compute_ignore_last_purchase_date(self): | ||
for move in self: | ||
move.ignore_last_purchase_date = move.picking_id.ignore_last_purchase_date | ||
move.product_id._compute_last_purchase_date() |
10 changes: 10 additions & 0 deletions
10
stock_move_ignore_last_purchase_date/models/stock_picking.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2023 Quartile Limited | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class StockPicking(models.Model): | ||
_inherit = "stock.picking" | ||
|
||
ignore_last_purchase_date = fields.Boolean() |
10 changes: 10 additions & 0 deletions
10
stock_move_ignore_last_purchase_date/readme/DESCRIPTION.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This module adds the *Ignore Last Purchase Date* field to the stock move to adjust | ||
assigning to last_purchase_date of product. | ||
|
||
Background | ||
~~~~~~~~~~ | ||
|
||
Certain receipts might be validated later than their actual reception date. | ||
Therefore, the "last purchase date" should not always correspond to the validation date. | ||
In such cases, instead of assigning the validation date to the "last purchase date", | ||
the "man last purchase date" should be used instead. |
Oops, something went wrong.