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

Make LGPL-3 compatible with Odoo Enterprise #74

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions news/74.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add a few valid dependency cases
- LGPL-3 module -> OEEL-1/OPL-1 module
- MIT module -> LGPL-3/OEEL-1/OPL-1 module
15 changes: 6 additions & 9 deletions src/manifestoo/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@

class LicenseType(Enum):
PROPRIETARY = 1
PERMISSIVE = 2 # MIT, Apache
PERMISSIVE = 2 # MIT
WEAKLY_PROTECTIVE = 3 # LGPL
STRONGLY_PROTECTIVE = 4 # GPL
NETWORK_PROTECTIVE = 5 # AGPL


def can_depend_on(work_license: LicenseType, dependency_license: LicenseType) -> bool:
if work_license == LicenseType.PROPRIETARY:
if work_license in (
LicenseType.PROPRIETARY,
LicenseType.PERMISSIVE,
LicenseType.WEAKLY_PROTECTIVE,
):
return dependency_license in (
LicenseType.PROPRIETARY,
LicenseType.PERMISSIVE,
LicenseType.WEAKLY_PROTECTIVE,
)
elif work_license == LicenseType.PERMISSIVE:
return dependency_license in (LicenseType.PERMISSIVE,)
elif work_license == LicenseType.WEAKLY_PROTECTIVE:
return dependency_license in (
LicenseType.WEAKLY_PROTECTIVE,
LicenseType.PERMISSIVE,
)
elif work_license == LicenseType.STRONGLY_PROTECTIVE:
return dependency_license in (
LicenseType.STRONGLY_PROTECTIVE,
Expand Down
17 changes: 17 additions & 0 deletions tests/test_cmd_check_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ def test_v12_ce_lgpl():
assert errors == []


def test_v16_ee_lgpl():
addons_set = mock_addons_set(
{
"a": {"depends": ["timer"], "license": "LGPL-3"},
"timer": {},
}
)
addons_selection = mock_addons_selection("a")
errors = check_licenses_command(
addons_selection,
addons_set,
transitive=False,
odoo_series=OdooSeries.v16_0,
)
assert errors == []


def test_v12_ee_proprietary():
addons_set = mock_addons_set(
{
Expand Down
Loading