mrp_subcontracting_security.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record model="ir.rule" id="production_subcontractor_rule">
  4. <field name="name">MRP Productions Subcontractor</field>
  5. <field name="model_id" ref="model_mrp_production"/>
  6. <field name="domain_force">[('subcontractor_id', '=', user.partner_id.commercial_partner_id.id)]</field>
  7. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  8. </record>
  9. <record model="ir.rule" id="bom_subcontractor_rule">
  10. <field name="name">MRP BoMs Subcontractor</field>
  11. <field name="model_id" ref="mrp.model_mrp_bom"/>
  12. <field name="domain_force">[('id', 'in', user.partner_id.commercial_partner_id.bom_ids.ids)]</field>
  13. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  14. </record>
  15. <record model="ir.rule" id="bom_line_subcontractor_rule">
  16. <field name="name">MRP BoM Lines Subcontractor</field>
  17. <field name="model_id" ref="mrp.model_mrp_bom_line"/>
  18. <field name="domain_force">[('id', 'in', user.partner_id.commercial_partner_id.bom_ids.bom_line_ids.ids)]</field>
  19. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  20. </record>
  21. <record model="ir.rule" id="consumption_warning_subcontractor_rule">
  22. <field name="name">MRP Consumption Warnings Subcontractor</field>
  23. <field name="model_id" ref="mrp.model_mrp_consumption_warning"/>
  24. <field name="domain_force">[('mrp_production_ids', 'in', user.partner_id.commercial_partner_id.production_ids.ids)]</field>
  25. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  26. </record>
  27. <record model="ir.rule" id="consumption_warning_line_subcontractor_rule">
  28. <field name="name">MRP Consumption Warning Lines Subcontractor</field>
  29. <field name="model_id" ref="mrp.model_mrp_consumption_warning_line"/>
  30. <field name="domain_force">[('mrp_production_id', 'in', user.partner_id.commercial_partner_id.production_ids.ids)]</field>
  31. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  32. </record>
  33. <record model="ir.rule" id="stock_move_subcontractor_rule">
  34. <field name="name">Stock Moves Subcontractor</field>
  35. <field name="model_id" ref="stock.model_stock_move"/>
  36. <field name="domain_force">[
  37. '|',
  38. '|',
  39. ('production_id.subcontractor_id', '=', user.partner_id.commercial_partner_id.id),
  40. ('move_orig_ids.production_id.subcontractor_id', 'in', user.partner_id.commercial_partner_id.ids),
  41. ('raw_material_production_id.subcontractor_id', 'in', user.partner_id.commercial_partner_id.ids)
  42. ]</field>
  43. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  44. </record>
  45. <record model="ir.rule" id="stock_move_line_subcontractor_rule">
  46. <field name="name">Stock Move Lines Subcontractor</field>
  47. <field name="model_id" ref="model_stock_move_line"/>
  48. <field name="domain_force">[
  49. '|',
  50. '|',
  51. ('move_id.production_id.subcontractor_id', '=', user.partner_id.commercial_partner_id.id),
  52. ('move_id.move_orig_ids.production_id.subcontractor_id', 'in', user.partner_id.commercial_partner_id.ids),
  53. ('move_id.raw_material_production_id.subcontractor_id', 'in', user.partner_id.commercial_partner_id.ids),
  54. ]</field>
  55. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  56. </record>
  57. <record model="ir.rule" id="picking_subcontractor_rule">
  58. <field name="name">Stock Pickings Subcontractor</field>
  59. <field name="model_id" ref="model_stock_picking"/>
  60. <field name="domain_force">[('partner_id.commercial_partner_id', '=', user.partner_id.commercial_partner_id.id)]</field>
  61. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  62. </record>
  63. <record model="ir.rule" id="picking_type_subcontractor_rule">
  64. <field name="name">Stock Picking Types Subcontractor</field>
  65. <field name="model_id" ref="stock.model_stock_picking_type"/>
  66. <field name="domain_force">['|', ('id', 'in', user.partner_id.commercial_partner_id.picking_ids.picking_type_id.ids), ('id', 'in', user.partner_id.commercial_partner_id.production_ids.picking_type_id.ids)]</field>
  67. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  68. </record>
  69. <record model="ir.rule" id="stock_location_subcontractor_rule">
  70. <field name="name">Stock Locations Subcontractor</field>
  71. <field name="model_id" ref="stock.model_stock_location"/>
  72. <field name="domain_force">[
  73. '|',
  74. '|',
  75. '|',
  76. '|',
  77. ('child_ids', 'in', user.partner_id.commercial_partner_id.picking_ids.location_id.ids),
  78. ('child_ids', 'in', user.partner_id.commercial_partner_id.picking_ids.location_dest_id.ids),
  79. '|',
  80. ('id', 'in', user.partner_id.commercial_partner_id.picking_ids.location_id.ids),
  81. ('id', 'in', user.partner_id.commercial_partner_id.picking_ids.location_dest_id.ids),
  82. '|',
  83. ('id', 'in', user.partner_id.commercial_partner_id.picking_ids.picking_type_id.warehouse_id.view_location_id.ids),
  84. ('id', 'in', user.partner_id.commercial_partner_id.production_ids.production_location_id.ids),
  85. ('id', 'in', user.partner_id.commercial_partner_id.production_ids.move_finished_ids.move_dest_ids.location_id.ids),
  86. ]</field>
  87. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  88. </record>
  89. <record model="ir.rule" id="stock_warehouse_subcontractor_rule">
  90. <field name="name">Warehouses Subcontractor</field>
  91. <field name="model_id" ref="stock.model_stock_warehouse"/>
  92. <field name="domain_force">[('id', 'in', user.partner_id.commercial_partner_id.picking_ids.picking_type_id.warehouse_id.ids)]</field>
  93. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  94. </record>
  95. <record id="stock_lot_subcontracting_rule" model="ir.rule">
  96. <field name="name">Stock Lot Subcontractor</field>
  97. <field name="model_id" ref="stock.model_stock_lot"/>
  98. <field name="domain_force">[
  99. '|',
  100. '|',
  101. ('product_id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_id.ids),
  102. ('product_id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_tmpl_id.product_variant_ids.ids),
  103. ('product_id', 'in', user.partner_id.commercial_partner_id.bom_ids.bom_line_ids.product_id.ids),
  104. ]</field>
  105. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  106. </record>
  107. <record id="product_template_subcontracting_rule" model="ir.rule">
  108. <field name="name">Product Template Subcontractor</field>
  109. <field name="model_id" ref="product.model_product_template"/>
  110. <field name="domain_force">[
  111. '|',
  112. '|',
  113. ('id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_id.product_tmpl_id.ids),
  114. ('id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_tmpl_id.ids),
  115. ('id', 'in', user.partner_id.commercial_partner_id.bom_ids.bom_line_ids.product_id.product_tmpl_id.ids),
  116. ]</field>
  117. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  118. </record>
  119. <record id="uom_subcontracting_rule" model="ir.rule">
  120. <field name="name">UoM Subcontractor</field>
  121. <field name="model_id" ref="uom.model_uom_uom"/>
  122. <field name="domain_force">[
  123. '|',
  124. '|',
  125. ('category_id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_id.product_tmpl_id.uom_id.category_id.ids),
  126. ('category_id', 'in', user.partner_id.commercial_partner_id.bom_ids.product_tmpl_id.uom_id.category_id.ids),
  127. ('category_id', 'in', user.partner_id.commercial_partner_id.bom_ids.bom_line_ids.product_id.product_tmpl_id.uom_id.category_id.ids),
  128. ]</field>
  129. <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
  130. </record>
  131. </odoo>