Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] stock_buffer_sales_analysis #342

Merged
merged 10 commits into from
Nov 21, 2023
6 changes: 6 additions & 0 deletions setup/stock_buffer_sales_analysis/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,
)
85 changes: 85 additions & 0 deletions stock_buffer_sales_analysis/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
===========================
Stock Buffer Sales Analysis
===========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5be06fa59a6e735f6e3cb74ec710382050265979e35e05c127b0276e3223a9d8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fddmrp-lightgray.png?logo=github
:target: https://github.com/OCA/ddmrp/tree/16.0/stock_buffer_sales_analysis
:alt: OCA/ddmrp
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/ddmrp-16-0/ddmrp-16-0-stock_buffer_sales_analysis
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/ddmrp&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Allows to access the sales analysis from a stock buffer,
through a smart button visible for the members of the group
*User: Own Documents Only* (same as the original permissions
for the same smart button shown in products).

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/ddmrp/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/OCA/ddmrp/issues/new?body=module:%20stock_buffer_sales_analysis%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
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~

* Carlos Serra-Toro <carlos.serra@camptocamp.com>
* `Trobz <https://trobz.com>`_:

Other credits
~~~~~~~~~~~~~

The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp

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

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/ddmrp <https://github.com/OCA/ddmrp/tree/16.0/stock_buffer_sales_analysis>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions stock_buffer_sales_analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from . import models
14 changes: 14 additions & 0 deletions stock_buffer_sales_analysis/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Stock Buffer Sales Analysis",
"summary": "Allows to access the Sales Analysis from Stock Buffers",
"version": "16.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/ddmrp",
"author": "Camptocamp, Odoo Community Association (OCA)",
"category": "Warehouse",
"depends": ["ddmrp", "sale", "sales_team"],
"data": ["views/stock_buffer_views.xml"],
"installable": True,
}
60 changes: 60 additions & 0 deletions stock_buffer_sales_analysis/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_buffer_sales_analysis
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"

#. module: stock_buffer_sales_analysis
#: model_terms:ir.ui.view,arch_db:stock_buffer_sales_analysis.stock_buffer_view_form
msgid "<span class=\"o_stat_text\">Sold</span>"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_id_sale_ok
msgid "Can be Sold"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__display_name
msgid "Display Name"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__id
msgid "ID"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer____last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_id_sales_count
msgid "Sold"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model_terms:ir.ui.view,arch_db:stock_buffer_sales_analysis.stock_buffer_view_form
msgid "Sold in the last 365 days"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model,name:stock_buffer_sales_analysis.model_stock_buffer
msgid "Stock Buffer"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_uom_name
msgid "Unit of Measure Name"
msgstr ""
44 changes: 44 additions & 0 deletions stock_buffer_sales_analysis/i18n/stock_buffer_sales_analysis.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_buffer_sales_analysis
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \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_buffer_sales_analysis
#: model_terms:ir.ui.view,arch_db:stock_buffer_sales_analysis.stock_buffer_view_form
msgid "<span class=\"o_stat_text\">Sold</span>"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_id_sale_ok
msgid "Can be Sold"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_id_sales_count
msgid "Sold"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model_terms:ir.ui.view,arch_db:stock_buffer_sales_analysis.stock_buffer_view_form
msgid "Sold in the last 365 days"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model,name:stock_buffer_sales_analysis.model_stock_buffer
msgid "Stock Buffer"
msgstr ""

#. module: stock_buffer_sales_analysis
#: model:ir.model.fields,field_description:stock_buffer_sales_analysis.field_stock_buffer__product_uom_name
msgid "Unit of Measure Name"
msgstr ""
3 changes: 3 additions & 0 deletions stock_buffer_sales_analysis/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from . import stock_buffer
25 changes: 25 additions & 0 deletions stock_buffer_sales_analysis/models/stock_buffer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import fields, models


class StockBuffer(models.Model):
_inherit = "stock.buffer"

product_uom_name = fields.Char(
"Unit of Measure Name", related="product_uom.name", readonly=True
)
product_id_sales_count = fields.Float(
"Sold", related="product_id.sales_count", readonly=True
)
product_id_sale_ok = fields.Boolean(
"Can be Sold", related="product_id.sale_ok", readonly=True
)

def action_view_sales(self):
self.ensure_one()
action = self.product_id.action_view_sales()
action["domain"] = [("product_id", "=", self.product_id.id)]
action["context"]["active_id"] = self.product_id.id
return action

Check warning on line 25 in stock_buffer_sales_analysis/models/stock_buffer.py

View check run for this annotation

Codecov / codecov/patch

stock_buffer_sales_analysis/models/stock_buffer.py#L21-L25

Added lines #L21 - L25 were not covered by tests
2 changes: 2 additions & 0 deletions stock_buffer_sales_analysis/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Carlos Serra-Toro <carlos.serra@camptocamp.com>
* `Trobz <https://trobz.com>`_:
1 change: 1 addition & 0 deletions stock_buffer_sales_analysis/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The migration of this module from 13.0 to 14.0 was financially supported by Camptocamp
4 changes: 4 additions & 0 deletions stock_buffer_sales_analysis/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Allows to access the sales analysis from a stock buffer,
through a smart button visible for the members of the group
*User: Own Documents Only* (same as the original permissions
for the same smart button shown in products).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading