Skip to content

Commit

Permalink
Merge PR #378 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Nov 25, 2024
2 parents 03d874f + 0b6c950 commit 9094d39
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 16 additions & 0 deletions dms_field/demo/partner_dms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,20 @@
</notebook>
</field>
</record>
<record id="access_group_demo" model="dms.access.group">
<field name="name">Admin (dms_field module)</field>
<field name="perm_create">True</field>
<field name="perm_write">True</field>
<field name="perm_unlink">True</field>
<field
name="explicit_user_ids"
eval="[(6, 0, [ref('base.user_admin'), ref('base.user_demo')])]"
/>
</record>
<record id="field_template_partner" model="dms.field.template">
<field name="name">Partner</field>
<field name="storage_id" ref="dms.storage_demo" />
<field name="model_id" ref="base.model_res_partner" />
<field name="group_ids" eval="[(6, 0, [ref('dms_field.access_group_demo')])]" />
</record>
</odoo>
15 changes: 1 addition & 14 deletions dms_field/tests/test_dms_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,10 @@ def setUpClass(cls):
{"name": "Test group", "users": [(4, cls.user_a.id)]}
)
cls.user_b = new_test_user(cls.env, login="test-user-b")
cls.template = cls.env["dms.field.template"].create(
{
"name": "Partner",
"storage_id": cls.env.ref("dms.storage_demo").id,
"model_id": cls.env.ref("base.model_res_partner").id,
"group_ids": [(4, cls.env.ref("dms.access_group_01_demo").id)],
"directory_format_name": "{{object.display_name}}",
}
)
cls.template = cls.env.ref("dms_field.field_template_partner")
cls.template.group_ids.group_ids = [(4, cls.group.id)]
cls.template.group_ids.explicit_user_ids = [(4, cls.user_b.id)]
cls.storage = cls.template.storage_id
template_ctx = cls.template.with_context(
res_model=cls.template._name, res_id=cls.template.id
)
template_ctx.create_dms_directory()
cls.template.invalidate_model()
cls.directory = cls.template.dms_directory_ids
cls.subdirectory_1 = cls.env["dms.directory"].create(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def setUpClass(cls):
)
access_group = cls.env.ref("dms.access_group_01_demo")
access_group.explicit_user_ids = [(4, cls.user.id)]
cls.env.ref("dms_field.field_template_partner").unlink()
file_template = cls.env["dms.field.template"].create(
{
"name": "Test partner template",
Expand Down

0 comments on commit 9094d39

Please sign in to comment.