Skip to content

Commit

Permalink
Merge pull request #121 from dhongu/15.0-stock-inventory
Browse files Browse the repository at this point in the history
[15.0][ADD]added stock_inventory_report module
  • Loading branch information
danila12 authored Jan 11, 2024
2 parents 2ae7f28 + 00620f1 commit 30a4f37
Show file tree
Hide file tree
Showing 14 changed files with 567 additions and 26 deletions.
9 changes: 5 additions & 4 deletions l10n_ro_edi_check/README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
========================
Romania - EDI data check
========================
==================================
Romania - EDI data check and queue
==================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4f7c203a3ab7d46a21ec7175bc2db5d294e9de106213827093fc642e95dae91e
!! source digest: sha256:0ae5b6f80e3e3d136c1b701026f7e4c17637f941d5f4d2be1edcfc851a23f084
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -23,6 +23,7 @@ Romania - EDI data check
|badge1| |badge2| |badge3|

Verificare date pentru trimitere ANAF la validarea facturii
Implementare cu coada job-uri

**Table of contents**

Expand Down
2 changes: 1 addition & 1 deletion l10n_ro_edi_check/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# © 2024-now Dan Stoica <danila(@)terrabit(.)ro
# See README.rst file on addons root folder for license details
{
"name": "Romania - EDI data check",
"name": "Romania - EDI data check and queue",
"license": "AGPL-3",
"version": "15.0.0.0.1",
"author": "Terrabit," "Odoo Community Association (OCA)",
Expand Down
26 changes: 10 additions & 16 deletions l10n_ro_edi_check/models/account_edi_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,36 @@
# See README.rst file on addons root folder for license details




from odoo import models, api, fields

import logging

_logger = logging.getLogger(__name__)
from odoo import api, fields, models

_logger = logging.getLogger(__name__)


class AccountEdiDocument(models.Model):
_inherit = 'account.edi.document'
_inherit = "account.edi.document"

@api.model
def _cron_process_documents_web_services(self, job_count=None):
domain = [
('state', 'in', ('to_send', 'to_cancel')),
('move_id.state', '=', 'posted'),
("move_id.date", ">=", "2024-01-01")
("state", "in", ("to_send", "to_cancel")),
("move_id.state", "=", "posted"),
("move_id.date", ">=", "2024-01-01"),
]
edi_documents = self.search(domain)

for edi_document in edi_documents:
edi_document.with_delay()._process_documents_web_services()

domain = [
('state', 'in', ('to_send', 'to_cancel')),
('move_id.state', '=', 'posted'),
("state", "in", ("to_send", "to_cancel")),
("move_id.state", "=", "posted"),
("blocking_level", "=", "error"),
("write_date", "<", fields.Date.today())
("write_date", "<", fields.Date.today()),
]
edi_documents = self.search(domain)
if edi_documents:
edi_documents.write({"blocking_level": False})

self.env.ref('queue_job_cron_jobrunner.queue_job_cron')._trigger()



self.env.ref("queue_job_cron_jobrunner.queue_job_cron")._trigger()
1 change: 1 addition & 0 deletions l10n_ro_edi_check/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Verificare date pentru trimitere ANAF la validarea facturii
Implementare cu coada job-uri
11 changes: 6 additions & 5 deletions l10n_ro_edi_check/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Romania - EDI data check</title>
<title>Romania - EDI data check and queue</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,17 +360,18 @@
</style>
</head>
<body>
<div class="document" id="romania-edi-data-check">
<h1 class="title">Romania - EDI data check</h1>
<div class="document" id="romania-edi-data-check-and-queue">
<h1 class="title">Romania - EDI data check and queue</h1>

<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4f7c203a3ab7d46a21ec7175bc2db5d294e9de106213827093fc642e95dae91e
!! source digest: sha256:0ae5b6f80e3e3d136c1b701026f7e4c17637f941d5f4d2be1edcfc851a23f084
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/l10n-romania/tree/15.0/l10n_ro_edi_check"><img alt="dhongu/l10n-romania" src="https://img.shields.io/badge/github-dhongu%2Fl10n--romania-lightgray.png?logo=github" /></a></p>
<p>Verificare date pentru trimitere ANAF la validarea facturii</p>
<p>Verificare date pentru trimitere ANAF la validarea facturii
Implementare cu coada job-uri</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand Down
65 changes: 65 additions & 0 deletions l10n_ro_stock_inventory_report/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
======================
Stock Inventory Report
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7fa0b4bb27d5e300b1c098841ca30678dd117000330da668685339c2c62ab905
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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-dhongu%2Fl10n--romania-lightgray.png?logo=github
:target: https://github.com/dhongu/l10n-romania/tree/15.0/l10n_ro_stock_inventory_report
:alt: dhongu/l10n-romania

|badge1| |badge2| |badge3|

Features:
- Corrects the sql for the storage sheet report to take into consideration the "active" field of the SVL

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/dhongu/l10n-romania/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/dhongu/l10n-romania/issues/new?body=module:%20l10n_ro_stock_inventory_report%0Aversion:%2015.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
~~~~~~~

* Terrabit
* Dan Stoica

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

.. |maintainer-danila12| image:: https://github.com/danila12.png?size=40px
:target: https://github.com/danila12
:alt: danila12

Current maintainer:

|maintainer-danila12|

This module is part of the `dhongu/l10n-romania <https://github.com/dhongu/l10n-romania/tree/15.0/l10n_ro_stock_inventory_report>`_ project on GitHub.

You are welcome to contribute.
6 changes: 6 additions & 0 deletions l10n_ro_stock_inventory_report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# © 2015-2023 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from . import models
19 changes: 19 additions & 0 deletions l10n_ro_stock_inventory_report/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# © 2015-2023 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

{
"name": "Stock Inventory Report",
"summary": "Link between Deltatech Stock Inventory and Romania - Stock Report (storage sheet)",
"version": "15.0.0.0.1",
"author": "Terrabit, Dan Stoica, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-romania",
"category": "Warehouse",
"depends": ["l10n_ro_stock_report"],
"license": "AGPL-3",
"data": [],
"images": ["images/main_screenshot.png"],
"installable": True,
"development_status": "Production/Stable",
"maintainers": ["danila12"],
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions l10n_ro_stock_inventory_report/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# © 2015-2023 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from . import stock_report
from . import stock_valuation_layer
15 changes: 15 additions & 0 deletions l10n_ro_stock_inventory_report/models/stock_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2015-2023 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from odoo import models


class StorageSheet(models.TransientModel):
_inherit = "l10n.ro.stock.storage.sheet"

def _get_sql_select_sold_final(self):
sql = super()._get_sql_select_sold_final()
sql = sql.replace("GROUP BY", " AND svl.active = 't' GROUP BY")
return sql
12 changes: 12 additions & 0 deletions l10n_ro_stock_inventory_report/models/stock_valuation_layer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# © 2015-2023 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from odoo import fields, models


class StockValuationLayer(models.Model):
_inherit = "stock.valuation.layer"

active = fields.Boolean(default=True)
2 changes: 2 additions & 0 deletions l10n_ro_stock_inventory_report/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Features:
- Corrects the sql for the storage sheet report to take into consideration the "active" field of the SVL
Loading

0 comments on commit 30a4f37

Please sign in to comment.