Skip to content

Commit

Permalink
[3515][ADD] stock_move_accounting_date (#31)
Browse files Browse the repository at this point in the history
* [3515][ADD] stock_move_acceptance_date
  • Loading branch information
rinaldifirdaus authored Aug 2, 2023
1 parent 6a12162 commit 2f82921
Show file tree
Hide file tree
Showing 12 changed files with 550 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_move_accounting_date/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,
)
54 changes: 54 additions & 0 deletions stock_move_accounting_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
==========================
Stock Move Accounting 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_accounting_date
:alt: qrtl/axls-custom

|badge1| |badge2| |badge3|

This module adds Accounting Date on stock move. When Accounting Date is specified in the stock picking,
the Accounting Date field will be populated with the value of the accounting date from stock picking.
Otherwise, the Accounting Date field will be populated with the value of Effective Date.

**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_accounting_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_accounting_date>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions stock_move_accounting_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions stock_move_accounting_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Move Accounting Date",
"version": "16.0.1.0.0",
"author": "Quartile Limited",
"website": "https://www.quartile.co",
"category": "Stock",
"license": "AGPL-3",
"depends": ["stock", "stock_picking_accounting_date"],
"data": [
"views/stock_move_views.xml",
],
"installable": True,
}
26 changes: 26 additions & 0 deletions stock_move_accounting_date/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_accounting_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-14 08:42+0000\n"
"PO-Revision-Date: 2023-07-14 08: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_accounting_date
#: model:ir.model.fields,field_description:stock_move_accounting_date.field_stock_move__accounting_date
msgid "Accounting Date"
msgstr "会計日"

#. module: stock_move_accounting_date
#: model:ir.model,name:stock_move_accounting_date.model_stock_move
msgid "Stock Move"
msgstr "在庫移動"
1 change: 1 addition & 0 deletions stock_move_accounting_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move
20 changes: 20 additions & 0 deletions stock_move_accounting_date/models/stock_move.py
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"

accounting_date = fields.Date(
compute="_compute_accounting_date",
store=True,
)

@api.depends("date", "accounting_date")
def _compute_accounting_date(self):
for line in self:
line.accounting_date = line.date
if line.picking_id.accounting_date:
line.accounting_date = line.picking_id.accounting_date
3 changes: 3 additions & 0 deletions stock_move_accounting_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module adds Accounting Date on stock move. When Accounting Date is specified in the stock picking,
the Accounting Date field will be populated with the value of the accounting date from stock picking.
Otherwise, the Accounting Date field will be populated with the value of Effective Date.
Loading

0 comments on commit 2f82921

Please sign in to comment.