flectra/addons/sale/security/sale_security.xml

188 lines
8.8 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<record id="sale.group_sale_layout" model="res.groups">
<field name="name">Personalize sales order and invoice report</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_delivery_invoice_address" model="res.groups">
<field name="name">Addresses in Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_show_price_subtotal" model="res.groups">
<field name="name">Tax display B2B</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="comment">Show line subtotals without taxes (B2B)</field>
</record>
<record id="group_show_price_total" model="res.groups">
<field name="name">Tax display B2C</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="comment">Show line subtotals with taxes included (B2C)</field>
</record>
<record model="res.groups" id="base.group_public">
<field name="implied_ids" eval="[(4, ref('sale.group_show_price_subtotal'))]"/>
</record>
<record model="res.groups" id="base.group_portal">
<field name="implied_ids" eval="[(4, ref('sale.group_show_price_subtotal'))]"/>
</record>
<record model="res.groups" id="base.group_user">
<field name="implied_ids" eval="[(4, ref('sale.group_show_price_subtotal'))]"/>
</record>
<record id="group_discount_per_so_line" model="res.groups">
<field name="name">Discount on lines</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_warning_sale" model="res.groups">
<field name="name">A warning can be set on a product or a customer (Sale)</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_proforma_sales" model="res.groups">
<field name="name">Pro-forma Invoices</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_analytic_accounting" model="res.groups">
<field name="name">Analytic Accounting for Sales</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="implied_ids" eval="[(4, ref('analytic.group_analytic_accounting'))]"/>
</record>
<record model="res.users" id="base.user_root">
<field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
</record>
<data noupdate="1">
<!-- Multi - Company Rules -->
<record model="ir.rule" id="sale_order_comp_rule">
<field name="name">Sales Order multi-company</field>
<field name="model_id" ref="model_sale_order"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule" id="sale_order_line_comp_rule">
<field name="name">Sales Order Line multi-company</field>
<field name="model_id" ref="model_sale_order_line"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule" id="sale_order_report_comp_rule">
<field name="name">Sales Order Analysis multi-company</field>
<field name="model_id" ref="model_sale_report"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
2018-01-17 11:23:19 +01:00
<!-- Multi - Branch Rules -->
<record model="ir.rule" id="sale_order_multi_branch_rule">
<field name="name">Sales Order multi-branch</field>
<field name="model_id" ref="model_sale_order"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=', False),'|',('branch_id','=',user.default_branch_id.id), ('branch_id','in', [b.id for b in user.branch_ids])]</field>
</record>
<record model="ir.rule" id="sale_order_line_multi_branch_rule">
<field name="name">Sales Order Line multi-branch</field>
<field name="model_id" ref="model_sale_order_line"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=', False),'|',('branch_id','=',user.default_branch_id.id), ('branch_id','in', [b.id for b in user.branch_ids])]</field>
</record>
<record model="ir.rule" id="sale_order_report_multi_branch_rule">
<field name="name">Sales Order Analysis multi-branch</field>
<field name="model_id" ref="model_sale_report"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('branch_id','=', False),'|',('branch_id','=',user.default_branch_id.id), ('branch_id','in', [b.id for b in user.branch_ids])]</field>
</record>
<!-- Portal Access Rules -->
<record id="sale_order_rule_portal" model="ir.rule">
<field name="name">Portal Personal Quotations/Sales Orders</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="domain_force">[('message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_read" eval="True"/>
<field name="perm_create" eval="False"/>
</record>
<record id="sale_order_line_rule_portal" model="ir.rule">
<field name="name">Portal Sales Orders Line</field>
<field name="model_id" ref="sale.model_sale_order_line"/>
<field name="domain_force">[('order_id.message_partner_ids','child_of',[user.commercial_partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]"/>
</record>
<!-- Multi - Salesmen sales order assignation rules -->
<record id="sale_order_personal_rule" model="ir.rule">
<field name="name">Personal Orders</field>
<field ref="model_sale_order" name="model_id"/>
<field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="sale_order_see_all" model="ir.rule">
<field name="name">All Orders</field>
<field ref="model_sale_order" name="model_id"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
<record id="sale_order_report_personal_rule" model="ir.rule">
<field name="name">Personal Orders Analysis</field>
<field ref="model_sale_report" name="model_id"/>
<field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="sale_order_report_see_all" model="ir.rule">
<field name="name">All Orders Analysis</field>
<field ref="model_sale_report" name="model_id"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
<record id="sale_order_line_personal_rule" model="ir.rule">
<field name="name">Personal Order Lines</field>
<field ref="model_sale_order_line" name="model_id"/>
<field name="domain_force">['|',('order_id.user_id','=',user.id),('order_id.user_id','=',False)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="sale_order_line_see_all" model="ir.rule">
<field name="name">All Orders Lines</field>
<field ref="model_sale_order_line" name="model_id"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
<record id="account_invoice_report_rule_see_personal" model="ir.rule">
<field name="name">Personal Invoices Analysis</field>
<field name="model_id" ref="model_account_invoice_report"/>
<field name="domain_force">['|', ('user_id', '=', user.id), ('user_id', '=', False)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="account_invoice_report_rule_see_all" model="ir.rule">
<field name="name">All Invoices Analysis</field>
<field name="model_id" ref="model_account_invoice_report"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
</data>
2018-01-16 11:34:37 +01:00
</flectra>