Skip to content

Commit

Permalink
[MIG] product_multi_company: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prabakaran04 authored and amkarthik committed Dec 18, 2023
1 parent 55ebf5b commit 24e9503
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion product_multi_company/models/product_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ProductCategory(models.Model):
)

route_ids = fields.Many2many(
"stock.location.route",
"stock.route",
"stock_location_route_categ",
"categ_id",
"route_id",
Expand Down
8 changes: 2 additions & 6 deletions product_multi_company/tests/test_product_multi_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
class TestProductMultiCompany(ProductMultiCompanyCommon, common.TransactionCase):
def test_create_product(self):
product = self.env["product.product"].create({"name": "Test"})
company = self.env.company
self.assertTrue(company.id in product.company_ids.ids)
self.assertFalse(product.company_ids)

def test_company_none(self):
self.assertFalse(self.product_company_none.company_id)
Expand Down Expand Up @@ -65,8 +64,5 @@ def test_uninstall(self):

uninstall_hook(self.env.cr, None)
rule = self.env.ref("product.product_comp_rule")
domain = (
" ['|', ('company_id', '=', user.company_id.id), "
"('company_id', '=', False)]"
)
domain = " [('company_id', 'in', [False, user.company_id.id])]"
self.assertEqual(rule.domain_force, domain)
14 changes: 10 additions & 4 deletions product_multi_company/views/product_template_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<field name="company_id" position="attributes">
<xpath
expr="//page[@name='general_information']//field[@name='company_id']"
position="attributes"
>
<attribute name="invisible">1</attribute>
</field>
<field name="company_id" position="after">
</xpath>
<xpath
expr="//page[@name='general_information']//field[@name='company_id']"
position="after"
>
<field
name="company_ids"
groups="base.group_multi_company"
widget="many2many_tags"
options="{'no_create': True}"
/>
</field>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 24e9503

Please sign in to comment.