Skip to content

Commit ebf73d2

Browse files
[ADD] stock_picking_accounting_date
1 parent bcfb25f commit ebf73d2

File tree

15 files changed

+734
-0
lines changed

15 files changed

+734
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../stock_picking_accounting_date
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
=============================
2+
Stock Picking Accounting Date
3+
=============================
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
15+
:alt: License: AGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
17+
:target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_picking_accounting_date
18+
:alt: OCA/stock-logistics-warehouse
19+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20+
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_picking_accounting_date
21+
:alt: Translate me on Weblate
22+
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23+
:target: https://runbot.odoo-community.org/runbot/153/16.0
24+
:alt: Try me on Runbot
25+
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
27+
28+
This module adds accounting date in picking and pass the value to accounting date
29+
of SVL's journal entry.
30+
31+
Background
32+
~~~~~~~~~~
33+
34+
When a user makes the transfer for the products with "real time"
35+
inventory valuation, effective date in transfer couldn't be selected.
36+
37+
And Accounting date for stock valuation journal entry will be the same with effective date.
38+
So, for the users who want to specify each transfer's actual accounting date needs to reset to draft
39+
manually and change acocunting date. This module intends to get rid of this
40+
inconvenience by adding accounting date in transfer and pass to journal entry.
41+
42+
**Table of contents**
43+
44+
.. contents::
45+
:local:
46+
47+
Bug Tracker
48+
===========
49+
50+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
51+
In case of trouble, please check there if your issue has already been reported.
52+
If you spotted it first, help us smashing it by providing a detailed and welcomed
53+
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_picking_accounting_date%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
55+
Do not contact contributors directly about support or help with technical issues.
56+
57+
Credits
58+
=======
59+
60+
Authors
61+
~~~~~~~
62+
63+
* Quartile Limited
64+
65+
Contributors
66+
~~~~~~~~~~~~
67+
68+
* `Quartile <https://www.quartile.co>`__:
69+
70+
* Aung Ko Ko Lin
71+
72+
Maintainers
73+
~~~~~~~~~~~
74+
75+
This module is maintained by the OCA.
76+
77+
.. image:: https://odoo-community.org/logo.png
78+
:alt: Odoo Community Association
79+
:target: https://odoo-community.org
80+
81+
OCA, or the Odoo Community Association, is a nonprofit organization whose
82+
mission is to support the collaborative development of Odoo features and
83+
promote its widespread use.
84+
85+
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_picking_accounting_date>`_ project on GitHub.
86+
87+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2023 Quartile Limited
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Stock Picking Accounting Date",
5+
"version": "16.0.1.0.0",
6+
"author": "Quartile Limited, Odoo Community Association (OCA)",
7+
"website": "https://github.com/OCA/stock-logistics-warehouse",
8+
"category": "Stock",
9+
"license": "AGPL-3",
10+
"depends": ["stock_account"],
11+
"data": [
12+
"views/stock_picking_views.xml",
13+
],
14+
"installable": True,
15+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * stock_picking_accounting_date
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2023-05-18 04:34+0000\n"
10+
"PO-Revision-Date: 2023-05-18 04:34+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: stock_picking_accounting_date
19+
#: model:ir.model.fields,field_description:stock_picking_accounting_date.field_stock_picking__accounting_date
20+
msgid "Accounting Date"
21+
msgstr "会計日"
22+
23+
#. module: stock_picking_accounting_date
24+
#: model:ir.model.fields,help:stock_picking_accounting_date.field_stock_picking__accounting_date
25+
msgid "Accounting date for stock valuation journal entry."
26+
msgstr "在庫評価仕訳の会計日"
27+
28+
#. module: stock_picking_accounting_date
29+
#: model:ir.model.fields,field_description:stock_picking_accounting_date.field_stock_picking__show_accounting_date
30+
msgid "Show Accounting Date"
31+
msgstr "会計日を表示"
32+
33+
#. module: stock_picking_accounting_date
34+
#: model:ir.model,name:stock_picking_accounting_date.model_stock_move
35+
msgid "Stock Move"
36+
msgstr "在庫移動"
37+
38+
#. module: stock_picking_accounting_date
39+
#: model:ir.model,name:stock_picking_accounting_date.model_stock_picking
40+
msgid "Transfer"
41+
msgstr "運送"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import stock_picking
2+
from . import stock_move
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2023 Quartile Limited
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class StockMove(models.Model):
8+
_inherit = "stock.move"
9+
10+
def _prepare_account_move_vals(
11+
self,
12+
credit_account_id,
13+
debit_account_id,
14+
journal_id,
15+
qty,
16+
description,
17+
svl_id,
18+
cost,
19+
):
20+
am_vals = super(StockMove, self)._prepare_account_move_vals(
21+
credit_account_id,
22+
debit_account_id,
23+
journal_id,
24+
qty,
25+
description,
26+
svl_id,
27+
cost,
28+
)
29+
if self.picking_id.accounting_date:
30+
am_vals.update({"date": self.picking_id.accounting_date})
31+
return am_vals
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2023 Quartile Limited
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import fields, models
5+
6+
7+
class StockPicking(models.Model):
8+
_inherit = "stock.picking"
9+
10+
accounting_date = fields.Date(
11+
states={"done": [("readonly", True)], "cancel": [("readonly", True)]},
12+
help="Accounting date for stock valuation journal entry.",
13+
)
14+
show_accounting_date = fields.Boolean(compute="_compute_show_accounting_date")
15+
16+
def _compute_show_accounting_date(self):
17+
for pick in self:
18+
pick.show_accounting_date = False
19+
if pick.picking_type_code not in ("incoming", "outgoing"):
20+
continue
21+
if pick.move_ids.with_company(pick.company_id).product_id.filtered(
22+
lambda x: x.detailed_type == "product" and x.valuation == "real_time"
23+
):
24+
pick.show_accounting_date = True
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* `Quartile <https://www.quartile.co>`__:
2+
3+
* Aung Ko Ko Lin

0 commit comments

Comments
 (0)