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] rental_product_pack #58

Open
wants to merge 75 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
75 commits
Select commit Hold shift + click to select a range
ad31fd3
Port sale_start_end_dates and sale_rental (#353)
Nov 8, 2016
9cdc3d4
sale_start_end_dates and sale_rental
dvdhinesh Nov 15, 2016
dfa6288
Product qty on rental pickings
alexis-via May 11, 2017
95b0765
Auto configure sale_rental module via post_install.py script
alexis-via May 24, 2017
14792b4
sale_rental: fix warning @constrains parameter 'must_have_dates' is n…
alexis-via Apr 4, 2018
70c3183
pylint
rousseldenis Sep 4, 2018
48e6e30
sale_rental: Migration to 11.0
Mar 29, 2019
1fdb437
[MIG] sale_start_end_dates and sale_rental to v12
alexis-via Jul 14, 2019
fc973e8
sale_rental: Improve the code of object sale.rental
alexis-via Jul 16, 2019
bce7f18
[IMP] enhancements suggested in code reviews
gurneyalex Oct 15, 2019
6bc1f0a
[FIX] Archive rental routes rather than delete
sadamo Oct 15, 2019
fecaf3f
[UPD] Update sale_rental.pot
oca-travis Sep 16, 2020
d8a4b81
[UPD] README.rst
OCA-git-bot Sep 16, 2020
380af26
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Oct 1, 2020
968f2cd
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Oct 2, 2020
dd9cb7d
Update translation files
oca-transbot Oct 9, 2020
bbd7ec8
Update translation files
oca-transbot Nov 22, 2020
2393b6c
Translated using Weblate (Portuguese)
pedrocs-exo Feb 8, 2021
408d006
[IMP] sale_rental: extract function _run_rental_procurement
yweng8111 Mar 5, 2021
eff7446
[UPD] Update sale_rental.pot
oca-travis Mar 12, 2021
3548296
sale_rental 12.0.1.1.0
OCA-git-bot Mar 12, 2021
eb5ca0b
Update translation files
oca-transbot Mar 12, 2021
30b389e
[UPD] Update sale_rental.pot
oca-travis Mar 12, 2021
b9d2689
Update translation files
oca-transbot Mar 12, 2021
007e3f5
[MIG] sale_rental from v12 to v14
alexis-via Jul 31, 2021
cf07c6a
sale_rental: black, isort, etc.
alexis-via Jul 31, 2021
4f1486f
[UPD] Update sale_rental.pot
oca-travis Dec 7, 2021
2f76051
[UPD] README.rst
OCA-git-bot Dec 7, 2021
f8f9113
[MIG] sale_rental: Migration to 15.0
kirca Jan 17, 2022
68f7ab1
[IMP] : black, isort, prettier, pylint
kirca Jan 17, 2022
55c4884
[UPD] Update sale_rental.pot
May 17, 2022
3ccdd58
[UPD] README.rst
OCA-git-bot May 17, 2022
2d8d924
sale_rental 15.0.1.0.1
OCA-git-bot May 17, 2022
3daa40a
[UPD] README.rst
OCA-git-bot Jun 2, 2022
933787b
[UPD] README.rst
OCA-git-bot Jun 2, 2022
f1f72a0
Translated using Weblate (French (France))
gregory-moka Jun 3, 2022
95adb0a
Translated using Weblate (French (France))
gregory-moka Jun 3, 2022
46f9cf4
Translated using Weblate (French)
gregory-moka Jul 4, 2022
5d83c16
[16.0][MIG] sale_rental
Murtaza-OSI Jan 3, 2023
db64170
[IMP] sale_rental: black, isort, prettier
Mar 7, 2024
b247abb
[FIX] rework unit test
Mar 14, 2024
0f18339
[IMP] sale_rental: black, isort, prettier
Mar 14, 2024
a947ac5
[IMP] sale_rental: pre-commit auto fixes
edescalona Nov 27, 2024
6768771
[IMP] sale_rental: pre-commit auto fixes
edescalona Nov 27, 2024
0494a67
[MIG] sale_rental: Migration to 17.0
edescalona Nov 27, 2024
550716d
[REM] Remove sale_rental module from branch 17.0
edescalona Nov 27, 2024
ed7bfc0
initial add of several rental modules
Oct 26, 2021
cd05c7e
[ADD] icon.png
OCA-git-bot Oct 26, 2021
d347520
[UPD] Update rental_product_pack.pot
oca-travis Nov 1, 2021
095f4d2
Update translation files
oca-transbot Nov 1, 2021
da917ec
[IMP] rental_product_pack: black, isort, prettier
chandni300 Jan 17, 2022
f4a5d2a
[MIG] rental_product_pack: Migration to 14.0
chandni300 Jan 17, 2022
d15e8a0
[UPD] Update rental_product_pack.pot
oca-travis Apr 19, 2022
2a052bb
rental_product_pack 14.0.1.0.1
OCA-git-bot Apr 19, 2022
1e9924d
[14.0][IMP] rental_product_pack: documentation improvement
chandni299 Oct 10, 2022
1d69c30
[IMP] rental_base, rental_offday, rental_pricelist, rental_pricelist_…
chandni299 Oct 10, 2022
c9cdc27
[IMP] change icon to rental modules
chandni299 Jan 3, 2023
1075c7b
[IMP] correct icon to rental modules
chandni299 Jan 17, 2023
0a6cf5e
Update translation files
weblate Oct 9, 2023
6e793c5
[IMP] remove data tags and string attribute from tree tag
chandni299 Feb 1, 2024
c324681
[IMP] rental_product_pack: black, isort, prettier
Feb 20, 2024
d3c1a97
[MIG] rental_product_pack: Migration to 15.0
Feb 20, 2024
95d39f5
[IMP] rental_product_pack: pre-commit auto fixes
edescalona Nov 28, 2024
5345985
[MIG] rental_product_pack: Migration to 17.0
edescalona Nov 28, 2024
e283e8f
[DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
a3fbb3c
[FIX][DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
b37fb73
[FIX][DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
c2b12fc
[FIX][DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
4034792
[FIX][DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
35261a0
[DON'T MERGE] test-requirements.txt
edescalona Nov 28, 2024
14da817
[DON'T MERGE] test-requirements.txt
edescalona Nov 29, 2024
d67f14b
[DON'T MERGE] test-requirements.txt
edescalona Nov 29, 2024
f942961
[DON'T MERGE] test-requirements.txt
edescalona Nov 29, 2024
f93d3ba
[17.0][FIX] correcting test
edescalona Nov 29, 2024
2048fb7
[17.0][FIX] correcting test
edescalona Nov 29, 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
60 changes: 60 additions & 0 deletions rental_product_pack/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Rental Product Pack
====================================================

*This file has been generated on 2023-02-19-14-21-34. Changes to it will be overwritten.*

Summary
-------

Manage rentals with product packs

Description
-----------

This module allows to manage rentals with product packs.
You can define product packs as described in the module product_pack.
The components of the pack are added to both rental stock pickings after order confirmation.


Usage
-----

Install the module.
No further configuration is needed.

Create at least one storable product that will be a component of a pack.
* Go to Rentals > Configuration > Settings.
* Please activate the checkbox for using 'Product Variants'.
* Go to Rentals > Products > Products.
* Create a new storable product.

Create a rentable pack product.
* Create a new storable product.
* Activate the checkbox 'Can be Rented' and 'Is Pack'.
* Go to page 'Pack'.
* Choose Pack Type (e.g. Non-detailled) and add the previously created storable products that are part of this pack.
* Go to page 'Sales & Purchase'.
* Create the rental service and configure its name and price.

Create a rental order:
* Go to Rentals > Customer > Rental Quotations.
* Create a new order and choose the type 'Rental Order'.
* Add the rental service of the rentable pack product as an order line.
* Set the quantity.
* Choose start and end date.
* Confirm the order.
* Check out the two deliveries, one for outgoing and one for incoming delivery.
* You can see all parts of the pack in both stock pickings.

Hint:
Refer to the usage information of the OCA module product_pack to learn how to
define product packs.
Please note, that this module does not include the behavior of the module sale_product_pack.

Changelog
---------

- 9089b1d5 2022-04-15 14:16:12 +0200 [email protected] (tag: odoo-fox-v15_v15_int_current_daily, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-26, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-25, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-23, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-22, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-21, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-17, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-16, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-15, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-13, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-12, tag: bp_fox_v15_integration-ceqp-2, tag: bp_fox_v15_integration-cep-27, tag: bp_fox_v15_integration-cep-26, tag: bp_fox_v15_integration-cep-25, tag: bp_fox_v15_integration-cep-23, tag: bp_fox_v15_integration-cep-22, tag: bp_fox_v15_integration-cep-21, tag: bp_fox_v15_integration-cep-17, tag: bp_fox_v15_integration-cep-16, tag: bp_fox_v15_integration-cep-15, tag: bp_fox_v15_integration-cep-13, tag: bp_fox_v15_integration-cep-12, tag: baseline_odoo-fox-v15_v15_fox_v15_daily_build-26, origin/fox_v15_integration-cep-26, origin/fox_v15_integration-cep-25, origin/fox_v15_integration-cep-23, origin/fox_v15_integration-cep-22, origin/fox_v15_integration-cep-21, origin/fox_v15_integration-cep-17, origin/fox_v15_integration-cep-16, origin/fox_v15_integration-cep-15, origin/fox_v15_integration-cep-13, origin/fox_v15_integration-cep-12) update module versions for v15 and remove old migration scripts (issue #4967)
- 8d191ff7 2022-04-10 15:41:16 +0200 [email protected] add missing/lost documentation (issue #4516)
- 4509f78a 2022-02-23 20:48:33 +0100 [email protected] (origin/feature_4516_add_files_ported_from_v12_v14, feature_4516_add_files_ported_from_v12_v14) add files ported to v14 by cpatel and khanhbui (issue #4516)

5 changes: 5 additions & 0 deletions rental_product_pack/README/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

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

elego Software Solutions GmbH, Odoo Community Association (OCA)
16 changes: 16 additions & 0 deletions rental_product_pack/README/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Rental Product Pack
====================================================

*This file has been generated on 2023-02-19-14-21-34. Changes to it will be overwritten.*

Summary
-------

Manage rentals with product packs

Description
-----------

This module allows to manage rentals with product packs.
You can define product packs as described in the module product_pack.
The components of the pack are added to both rental stock pickings after order confirmation.
7 changes: 7 additions & 0 deletions rental_product_pack/README/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Changelog
---------

- 9089b1d5 2022-04-15 14:16:12 +0200 [email protected] (tag: odoo-fox-v15_v15_int_current_daily, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-26, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-25, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-23, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-22, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-21, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-17, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-16, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-15, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-13, tag: daily_odoo-fox-v15_v15_fox_v15_daily_build-12, tag: bp_fox_v15_integration-ceqp-2, tag: bp_fox_v15_integration-cep-27, tag: bp_fox_v15_integration-cep-26, tag: bp_fox_v15_integration-cep-25, tag: bp_fox_v15_integration-cep-23, tag: bp_fox_v15_integration-cep-22, tag: bp_fox_v15_integration-cep-21, tag: bp_fox_v15_integration-cep-17, tag: bp_fox_v15_integration-cep-16, tag: bp_fox_v15_integration-cep-15, tag: bp_fox_v15_integration-cep-13, tag: bp_fox_v15_integration-cep-12, tag: baseline_odoo-fox-v15_v15_fox_v15_daily_build-26, origin/fox_v15_integration-cep-26, origin/fox_v15_integration-cep-25, origin/fox_v15_integration-cep-23, origin/fox_v15_integration-cep-22, origin/fox_v15_integration-cep-21, origin/fox_v15_integration-cep-17, origin/fox_v15_integration-cep-16, origin/fox_v15_integration-cep-15, origin/fox_v15_integration-cep-13, origin/fox_v15_integration-cep-12) update module versions for v15 and remove old migration scripts (issue #4967)
- 8d191ff7 2022-04-10 15:41:16 +0200 [email protected] add missing/lost documentation (issue #4516)
- 4509f78a 2022-02-23 20:48:33 +0100 [email protected] (origin/feature_4516_add_files_ported_from_v12_v14, feature_4516_add_files_ported_from_v12_v14) add files ported to v14 by cpatel and khanhbui (issue #4516)
35 changes: 35 additions & 0 deletions rental_product_pack/README/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

Usage
-----

Install the module.
No further configuration is needed.

Create at least one storable product that will be a component of a pack.
* Go to Rentals > Configuration > Settings.
* Please activate the checkbox for using 'Product Variants'.
* Go to Rentals > Products > Products.
* Create a new storable product.

Create a rentable pack product.
* Create a new storable product.
* Activate the checkbox 'Can be Rented' and 'Is Pack'.
* Go to page 'Pack'.
* Choose Pack Type (e.g. Non-detailled) and add the previously created storable products that are part of this pack.
* Go to page 'Sales & Purchase'.
* Create the rental service and configure its name and price.

Create a rental order:
* Go to Rentals > Customer > Rental Quotations.
* Create a new order and choose the type 'Rental Order'.
* Add the rental service of the rentable pack product as an order line.
* Set the quantity.
* Choose start and end date.
* Confirm the order.
* Check out the two deliveries, one for outgoing and one for incoming delivery.
* You can see all parts of the pack in both stock pickings.

Hint:
Refer to the usage information of the OCA module product_pack to learn how to
define product packs.
Please note, that this module does not include the behavior of the module sale_product_pack.
2 changes: 2 additions & 0 deletions rental_product_pack/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.
from . import models
24 changes: 24 additions & 0 deletions rental_product_pack/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.

{
"name": "Rental Product Pack",
"version": "17.0.1.0.0",
"category": "Rental",
"summary": "Manage rentals with product packs",
"author": "elego Software Solutions GmbH, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/vertical-rental",
"depends": [
"rental_base",
"product_pack",
],
"data": [
"security/ir.model.access.csv",
"views/product_view.xml",
"views/product_pack_line_view.xml",
],
"demo": [],
"qweb": [],
"application": False,
"installable": True,
"license": "AGPL-3",
}
77 changes: 77 additions & 0 deletions rental_product_pack/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * rental_product_pack
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-29 16:26+0000\n"
"PO-Revision-Date: 2021-12-29 16:26+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: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__used_pack_line_count
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__used_pack_line_count
msgid "# Used Pack Line Count"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__display_name
msgid "Display Name"
msgstr "Anzeigename"

#. module: rental_product_pack
#: model_terms:ir.ui.view,arch_db:rental_product_pack.product_template_only_form_view
#: model_terms:ir.ui.view,arch_db:rental_product_pack.rental_product_pack_form
msgid "Found in packs"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__id
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__id
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order__id
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__id
msgid "ID"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move____last_update
msgid "Last Modified on"
msgstr "Zuletzt geändert am"

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_product_product
msgid "Product"
msgstr "Produkt"

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_product_template
msgid "Product Template"
msgstr "Produktvorlage"

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__rental_pack_move_id
msgid "Rental Main Pack Move"
msgstr "Lagerbewegung des Hauptmietproduktes"

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_sale_order
msgid "Sales Order"
msgstr "Verkaufsauftrag"

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_stock_move
msgid "Stock Move"
msgstr "Lagerbewegung"
77 changes: 77 additions & 0 deletions rental_product_pack/i18n/rental_product_pack.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * rental_product_pack
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-29 16:26+0000\n"
"PO-Revision-Date: 2021-12-29 16:26+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: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__used_pack_line_count
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__used_pack_line_count
msgid "# Used Pack Line Count"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order__display_name
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__display_name
msgid "Display Name"
msgstr ""

#. module: rental_product_pack
#: model_terms:ir.ui.view,arch_db:rental_product_pack.product_template_only_form_view
#: model_terms:ir.ui.view,arch_db:rental_product_pack.rental_product_pack_form
msgid "Found in packs"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product__id
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template__id
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order__id
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__id
msgid "ID"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_product_product____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_product_template____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_sale_order____last_update
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_product_product
msgid "Product"
msgstr ""

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_product_template
msgid "Product Template"
msgstr ""

#. module: rental_product_pack
#: model:ir.model.fields,field_description:rental_product_pack.field_stock_move__rental_pack_move_id
msgid "Rental Main Pack Move"
msgstr ""

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: rental_product_pack
#: model:ir.model,name:rental_product_pack.model_stock_move
msgid "Stock Move"
msgstr ""
4 changes: 4 additions & 0 deletions rental_product_pack/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.
from . import sale
from . import stock
from . import product
26 changes: 26 additions & 0 deletions rental_product_pack/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.

from odoo import api, fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

used_pack_line_count = fields.Integer(
string="# Used Pack Line Count",
compute="_compute_used_pack_line_count",
)

@api.depends("pack_line_ids")
def _compute_used_pack_line_count(self):
for rec in self:
rec.used_pack_line_count = len(rec.used_in_pack_line_ids)

Check warning on line 17 in rental_product_pack/models/product.py

View check run for this annotation

Codecov / codecov/patch

rental_product_pack/models/product.py#L17

Added line #L17 was not covered by tests


class ProductProduct(models.Model):
_inherit = "product.product"

used_pack_line_count = fields.Integer(
string="# Used Pack Line Count",
related="product_tmpl_id.used_pack_line_count",
)
33 changes: 33 additions & 0 deletions rental_product_pack/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.

from odoo import models


class SaleOrder(models.Model):
_inherit = "sale.order"

def action_confirm(self):
res = super().action_confirm()
for order in self:
out_pickings = order.picking_ids.filtered(
lambda x: x.picking_type_id.code == "outgoing" and x.state != "cancel"
)
in_pickings = order.picking_ids.filtered(
lambda x: x.picking_type_id.code == "incoming" and x.state != "cancel"
)
for picking in out_pickings:
for move in picking.move_ids_without_package:
if move.product_id and move.product_id.pack_ok:
for line in move.product_id.pack_line_ids:
qty = move.product_uom_qty * line.quantity
move.copy(
{
"product_id": line.product_id.id,
"product_uom_qty": qty,
"rental_pack_move_id": move.id,
"picking_id": move.picking_id.id,
}
)
out_pickings.action_confirm()
in_pickings.action_confirm()
return res
12 changes: 12 additions & 0 deletions rental_product_pack/models/stock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Part of rental-vertical See LICENSE file for full copyright and licensing details.

from odoo import fields, models


class StockMove(models.Model):
_inherit = "stock.move"

rental_pack_move_id = fields.Many2one(
string="Rental Main Pack Move",
comodel_name="stock.move",
)
3 changes: 3 additions & 0 deletions rental_product_pack/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions rental_product_pack/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
product_pack.access_product_pack_line_user,product.pack.line,product_pack.model_product_pack_line,base.group_user,1,1,1,1
Binary file added rental_product_pack/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading