Files
Odoo-Modules/fusion_labels/fusion_labels_pro/tests/test_access_rights.py
gsinghpal db4b9aa278 changes
2026-03-11 12:15:53 -04:00

26 lines
997 B
Python

# Copyright © 2025 Nexa Systems Inc (https://nexasystems.ca)
# @author: Nexa Systems Inc (support@nexasystems.ca)
# License OPL-1 (https://www.odoo.com/documentation/16.0/legal/licenses.html).
from odoo.tests import tagged
from odoo.addons.base.tests.common import BaseUsersCommon
from .common import TestProductLabel
@tagged('post_install', '-at_install')
class TestAccessRights(BaseUsersCommon, TestProductLabel):
def test_access_internal_user(self):
""" Test internal user's access rights """
PrintWizard = self.env['print.product.label'].with_user(self.user_internal)
wizard_as_internal_user = PrintWizard.browse(self.print_wizard.id)
# Internal user can use label templates
wizard_as_internal_user.read()
# Internal user can change label templates
wizard_as_internal_user.write({'template_id': self.label_template_50x25.id})
# Internal user can preview label templates
wizard_as_internal_user.action_print()