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

[17.0][MIG] sale_stock_secondary_unit: Migration to 17.0 #3238

Open
wants to merge 23 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d4d6a18
[11.0][ADD] sale_stock_secondary_unit: New module for store secondary…
sergio-teruel Feb 19, 2019
1726161
[MIG] sale_stock_secondary_unit: Migration to 12.0
digitalsatori Oct 21, 2019
b14d0aa
[MIG] sale_stock_secondary_unit: Migration to v13.0
sergio-teruel Jan 28, 2020
8656f96
[UPD] Update sale_stock_secondary_unit.pot
oca-travis Feb 18, 2020
98f7440
Added translation using Weblate (Spanish)
danimv5 Jul 27, 2020
f98dc8d
Translated using Weblate (Spanish)
danimv5 Jul 27, 2020
cb825cd
[IMP] sale_stock_secondary_unit: Promote to Stable
etobella Apr 19, 2022
0959cda
[UPD] README.rst
OCA-git-bot Apr 20, 2022
f29bb5a
sale_stock_secondary_unit 13.0.1.0.1
OCA-git-bot Apr 20, 2022
231e9d1
[MIG] sale_stock_secondary_unit: Migration to v15.0
sergio-teruel Oct 25, 2022
cb7244b
[UPD] Update sale_stock_secondary_unit.pot
Jan 12, 2023
b54ca0f
[FIX] sale_stock_secondary_unit: Propagate secondary_uom to chained s…
sergio-teruel Feb 27, 2023
780b3d1
sale_stock_secondary_unit 15.0.1.0.1
OCA-git-bot Mar 8, 2023
9709d6d
Added translation using Weblate (Italian)
francesco-ooops Jun 6, 2023
146cffa
Translated using Weblate (Italian)
francesco-ooops Jun 6, 2023
f324ea4
[UPD] README.rst
OCA-git-bot Sep 3, 2023
2703cfe
[IMP] sale_stock_secondary_unit: test performance improvement
josep-tecnativa Oct 24, 2023
9aed4a6
[BOT] post-merge updates
OCA-git-bot Oct 24, 2023
4b09971
[FIX] sale_stock_secondary_unit: Fix test, second qty manage qty done
sergio-teruel Nov 27, 2023
82ba2b9
[BOT] post-merge updates
OCA-git-bot Dec 13, 2023
60e6333
[IMP] sale_stock_secondary_unit: pre-commit execution
rov-adhoc Jul 16, 2024
a392150
[MIG] sale_stock_secondary_unit: Migration to 17.0
rov-adhoc Jul 16, 2024
408529c
[17.0][MIG] sale_stock_secondary_unit: Migration to 17.0
rov-adhoc Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions sale_stock_secondary_unit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=========================
Sale Stock Secondary Unit
=========================

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

.. |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-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/17.0/sale_stock_secondary_unit
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_stock_secondary_unit
: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/sale-workflow&target_branch=17.0
:alt: Try me on Runboat

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

This module extends the functionality of stock secondary unit module and
sale_order_secondary_unit to allow copy secondary sale data to stock
move when a sale order is confirmed.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module you need to:

1. Go to a *Product > General Information tab*.
2. Create any record in "Secondary unit of measure".
3. Set the conversion factor.
4. Go to *Sale > Quotation* and create a sale order with this product.
5. Confirm the sale order.
6. Go to picking from this sale order, you will see secondary unit
information.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_stock_secondary_unit%0Aversion:%2017.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
-------

* Tecnativa

Contributors
------------

- Carlos Dauden <carlos.dauden@tecnativa.com>
- Sergio Teruel <sergio.teruel@tecnativa.com>
- Tony Gu <tony@openerp.cn>

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/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_stock_secondary_unit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_stock_secondary_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models
16 changes: 16 additions & 0 deletions sale_stock_secondary_unit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Stock Secondary Unit",
"summary": "Get product quantities in a secondary unit",
"version": "17.0.1.0.0",
"development_status": "Production/Stable",
"category": "stock",
"website": "https://github.com/OCA/sale-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["sale_order_secondary_unit", "stock_secondary_unit"],
"auto_install": True,
}
20 changes: 20 additions & 0 deletions sale_stock_secondary_unit/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_secondary_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: de\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: sale_stock_secondary_unit
#: model:ir.model,name:sale_stock_secondary_unit.model_stock_rule
msgid "Stock Rule"
msgstr ""
22 changes: 22 additions & 0 deletions sale_stock_secondary_unit/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_secondary_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-07-27 10:19+0000\n"
"Last-Translator: Daniel Martinez Vila <daniel.martinez@qubiq.es>\n"
"Language-Team: none\n"
"Language: es\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"
"X-Generator: Weblate 3.10\n"

#. module: sale_stock_secondary_unit
#: model:ir.model,name:sale_stock_secondary_unit.model_stock_rule
msgid "Stock Rule"
msgstr "Regla de stock"
22 changes: 22 additions & 0 deletions sale_stock_secondary_unit/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_secondary_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-06 17:10+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\n"
"Language-Team: none\n"
"Language: it\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"
"X-Generator: Weblate 4.17\n"

#. module: sale_stock_secondary_unit
#: model:ir.model,name:sale_stock_secondary_unit.model_stock_rule
msgid "Stock Rule"
msgstr "Regola di giacenza"
19 changes: 19 additions & 0 deletions sale_stock_secondary_unit/i18n/sale_stock_secondary_unit.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_secondary_unit
#
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: sale_stock_secondary_unit
#: model:ir.model,name:sale_stock_secondary_unit.model_stock_rule
msgid "Stock Rule"
msgstr ""
23 changes: 23 additions & 0 deletions sale_stock_secondary_unit/i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_secondary_unit
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Tony Gu<tony@openerp.cn>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_stock_secondary_unit
#: model:ir.model,name:sale_stock_secondary_unit.model_stock_rule
msgid "Stock Rule"
msgstr ""

#~ msgid "Procurement Rule"
#~ msgstr "补货规则"
2 changes: 2 additions & 0 deletions sale_stock_secondary_unit/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import stock_rule
44 changes: 44 additions & 0 deletions sale_stock_secondary_unit/models/stock_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models


class StockRule(models.Model):
_inherit = "stock.rule"

def _get_stock_move_values(
self,
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
):
res = super()._get_stock_move_values(
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
)
sale_line_id = values.get("sale_line_id", False)
# Record can be a sale order line or a stock move depending of pull
# and push rules
if sale_line_id:
record = self.env["sale.order.line"].browse(sale_line_id)
else:
record = values.get("move_dest_ids", self.env["stock.move"].browse())[:1]
if record and record.secondary_uom_id:
res.update(
{
"secondary_uom_id": record.secondary_uom_id.id,
"secondary_uom_qty": record.secondary_uom_qty,
}
)
return res
3 changes: 3 additions & 0 deletions sale_stock_secondary_unit/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions sale_stock_secondary_unit/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Carlos Dauden \<<carlos.dauden@tecnativa.com>\>
- Sergio Teruel \<<sergio.teruel@tecnativa.com>\>
- Tony Gu \<<tony@openerp.cn>\>
3 changes: 3 additions & 0 deletions sale_stock_secondary_unit/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module extends the functionality of stock secondary unit module and
sale_order_secondary_unit to allow copy secondary sale data to stock
move when a sale order is confirmed.
9 changes: 9 additions & 0 deletions sale_stock_secondary_unit/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
To use this module you need to:

1. Go to a *Product \> General Information tab*.
2. Create any record in "Secondary unit of measure".
3. Set the conversion factor.
4. Go to *Sale \> Quotation* and create a sale order with this product.
5. Confirm the sale order.
6. Go to picking from this sale order, you will see secondary unit
information.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading