Skip to content

Commit

Permalink
[18.0][MIG] product_multi_company: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BertVGroenendael committed Oct 24, 2024
1 parent d0cbfa2 commit 3433871
Show file tree
Hide file tree
Showing 21 changed files with 190 additions and 230 deletions.
16 changes: 6 additions & 10 deletions product_multi_company/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Product multi-company
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8aecab69fa7d09b29e14ba2967815e73ad8a54e725fac700a6f6e841fd4ba9e1
!! source digest: sha256:d2f98eb7159237865e4860d63b7f63f512f107ab0ee820e060d36724bf5c2227
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -47,10 +47,10 @@ removal and reinstallation will serve.
Usage
=====

On the product form view, go to the "General Information" tab, and put
the companies in which you want to use that product. If none is
selected, the product will be visible in all of them. The default value
is the current one.
On the product form view, go to the "Information" tab, and put the
companies in which you want to use that product. If none is selected,
the product will be visible in all of them. The default value is the
current one.

Bug Tracker
===========
Expand Down Expand Up @@ -78,13 +78,9 @@ Contributors
- `Tecnativa <https://www.tecnativa.com>`__:

- Vicent Cubells <[email protected]>
- Pilar Vargas

- Denis Roussel <[email protected]>
- `Sodexis <https://sodexis.com>`__:

- Prabakaran <[email protected]>
- Karthik <[email protected]>
- Bert Van Groenendael <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion product_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"category": "Product Management",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["base_multi_company", "product"],
"depends": ["base_multi_company", "product", "stock"],
"data": ["views/product_template_view.xml"],
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
Expand Down
39 changes: 21 additions & 18 deletions product_multi_company/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

import logging

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)

try:
Expand All @@ -13,22 +11,27 @@
_logger.info("Cannot find `base_multi_company` module in addons path.")


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
# Change access rule
rule = env.ref("product.product_comp_rule")
rule.write(
{
"domain_force": (
"['|', ('company_ids', 'in', company_ids),"
"('company_ids', '=', False)]"
),
}
def post_init_hook(env):
hooks.post_init_hook(
env,
"product.product_comp_rule",
"product.template",
)


def uninstall_hook(cr, registry):
hooks.uninstall_hook(
cr,
"product.product_comp_rule",
)
def uninstall_hook(env):
"""Restore product rule to base value.
Args:
env (Environment): Environment to use for operation.
"""
rule = env.ref("product.product_comp_rule")
if rule: # safeguard if it's deleted
rule.write(
{
"domain_force": (
" ['|', ('company_id', 'parent_of', company_ids),"
" ('company_id', '=', False)]"
),
}
)
37 changes: 18 additions & 19 deletions product_multi_company/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ msgstr ""
"X-Generator: Weblate 4.17\n"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_product__company_ids
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__company_ids
msgid "Companies"
msgstr "Compañías"
Expand All @@ -31,26 +30,26 @@ msgid "Company"
msgstr "Compañía"

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product"
msgstr ""
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__no_company_ids
msgid "No Companies"
msgstr "No Compañías"

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

#~ msgid "Product Template (Multi-Company)"
#~ msgstr "Plantilla de producto (multi-compañía)"

#~ msgid "No Companies"
#~ msgstr "No Compañías"
#: model:ir.model,name:product_multi_company.model_product_category
msgid "Product Category"
msgstr "Categoría de producto"

#~ msgid "Product Category"
#~ msgstr "Categoría de producto"
#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product Template (Multi-Company)"
msgstr "Plantilla de producto (multi-compañía)"

#~ msgid "Routes"
#~ msgstr "Rutas"
#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__route_ids
msgid "Routes"
msgstr "Rutas"

#~ msgid "Total routes"
#~ msgstr "Total de rutas"
#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__total_route_ids
msgid "Total routes"
msgstr "Total de rutas"
22 changes: 18 additions & 4 deletions product_multi_company/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_product__company_ids
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__company_ids
msgid "Companies"
msgstr "Sociétés"
Expand All @@ -29,12 +28,27 @@ msgstr "Sociétés"
msgid "Company"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__no_company_ids
msgid "No Companies"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_category
msgid "Product Category"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product"
msgid "Product Template (Multi-Company)"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__route_ids
msgid "Routes"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_product
msgid "Product Variant"
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__total_route_ids
msgid "Total routes"
msgstr ""
25 changes: 18 additions & 7 deletions product_multi_company/i18n/hr.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ msgstr ""
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_product__company_ids
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__company_ids
msgid "Companies"
msgstr "Tvrtke"
Expand All @@ -31,14 +30,26 @@ msgid "Company"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product"
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__no_company_ids
msgid "No Companies"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_product
msgid "Product Variant"
#: model:ir.model,name:product_multi_company.model_product_category
msgid "Product Category"
msgstr ""

#~ msgid "Product Template (Multi-Company)"
#~ msgstr "Predložak proizvoda ( više tvrtki)"
#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product Template (Multi-Company)"
msgstr "Predložak proizvoda ( više tvrtki)"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__route_ids
msgid "Routes"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__total_route_ids
msgid "Total routes"
msgstr ""
38 changes: 0 additions & 38 deletions product_multi_company/i18n/it.po

This file was deleted.

25 changes: 18 additions & 7 deletions product_multi_company/i18n/nl_NL.po
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_product__company_ids
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__company_ids
msgid "Companies"
msgstr "Bedrijven"
Expand All @@ -31,14 +30,26 @@ msgid "Company"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product"
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__no_company_ids
msgid "No Companies"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_product
msgid "Product Variant"
#: model:ir.model,name:product_multi_company.model_product_category
msgid "Product Category"
msgstr ""

#~ msgid "Product Template (Multi-Company)"
#~ msgstr "Productsjabloon (Meerdere Bedrijven)"
#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product Template (Multi-Company)"
msgstr "Productsjabloon (Meerdere Bedrijven)"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__route_ids
msgid "Routes"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__total_route_ids
msgid "Total routes"
msgstr ""
24 changes: 19 additions & 5 deletions product_multi_company/i18n/product_multi_company.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -14,7 +14,6 @@ msgstr ""
"Plural-Forms: \n"

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_product__company_ids
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__company_ids
msgid "Companies"
msgstr ""
Expand All @@ -24,12 +23,27 @@ msgstr ""
msgid "Company"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_template__no_company_ids
msgid "No Companies"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_category
msgid "Product Category"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_template
msgid "Product"
msgid "Product Template (Multi-Company)"
msgstr ""

#. module: product_multi_company
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__route_ids
msgid "Routes"
msgstr ""

#. module: product_multi_company
#: model:ir.model,name:product_multi_company.model_product_product
msgid "Product Variant"
#: model:ir.model.fields,field_description:product_multi_company.field_product_category__total_route_ids
msgid "Total routes"
msgstr ""
Loading

0 comments on commit 3433871

Please sign in to comment.