diff --git a/__manifest__.py b/__manifest__.py index 301ddca4dd3ae883b0c083092f31481650fd1ecc..d26de549b348bfde84187fa24f8b23a721a808cb 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -19,6 +19,8 @@ "views/cgscop_timesheet_code.xml", "views/hr_timesheet.xml", "views/hr_timesheet_cgscop.xml", + "views/res_partner.xml", + "views/ur_financial_system.xml", "datas/cgscop.timesheet.code.csv", ] } diff --git a/models/hr_timesheet.py b/models/hr_timesheet.py index 82f77c093f257e7e412bf227e66edef34189a07d..05e8fcd264e2282b63fef6a55ff8a373362e94bc 100644 --- a/models/hr_timesheet.py +++ b/models/hr_timesheet.py @@ -10,7 +10,7 @@ class ScopHrTimesheet(models.Model): name = fields.Char(required=False) cgscop_timesheet_code_id = fields.Many2one( related='project_id.cgscop_timesheet_code_id', - string='Code Activité CG', + string='Code Activité National', store=True) ur_financial_system_id = fields.Many2one( comodel_name='ur.financial.system', diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index a5416be78fefc73d3ecb0056622e0185a98408ba..e34ddb6166e86f5abc15a10d4f55cf431bb046c4 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,3 +1,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_cgscop_timesheet_code,access_cgscop_timesheet_code,model_cgscop_timesheet_code,base.group_user,1,0,0,0 access_ur_financial_system,access_ur_financial_system,model_ur_financial_system,base.group_user,1,0,0,0 +access_ur_financial_system_ur_manager,access_ur_financial_system_ur,model_ur_financial_system,cgscop_partner.group_ur_list_modif,1,1,1,1 +access_ur_financial_system_cg_manager,access_ur_financial_system_cg,model_ur_financial_system,cgscop_partner.group_cg_administrator,1,1,1,1 +access_project_project_ur_manager,access_project_project_ur,model_project_project,cgscop_partner.group_ur_list_modif,1,1,1,1 +access_project_project_cg_manager,access_project_project_cg,model_project_project,cgscop_partner.group_cg_administrator,1,1,1,1 +access_account_analytic_account_ur_manager,access_account_analytic_account_ur,analytic.model_account_analytic_account,cgscop_partner.group_ur_list_modif,1,1,1,1 +access_account_analytic_account_cg_manager,access_account_analytic_account_cg,analytic.model_account_analytic_account,cgscop_partner.group_cg_administrator,1,1,1,1 diff --git a/views/cgscop_timesheet_code.xml b/views/cgscop_timesheet_code.xml index fbf5240519ab27c955c9298d55f22af1f46f1535..2e4cacaeae17e6052c0cdd721b1ce487fbdac9b7 100644 --- a/views/cgscop_timesheet_code.xml +++ b/views/cgscop_timesheet_code.xml @@ -23,11 +23,11 @@ </record> <menuitem id="menu_cgscop_timesheet_code" - name="Codes activité CG" + name="Codes activité National" parent="hr_timesheet.hr_timesheet_menu_configuration" action="action_cgscop_timesheet_code_tree" sequence="50" - groups="analytic.group_analytic_accounting"/> + groups="cgscop_partner.group_cg_administrator"/> </data> </odoo> \ No newline at end of file diff --git a/views/hr_timesheet.xml b/views/hr_timesheet.xml index 570b1d296dc3bc29a3fc35fbd63bd3306877719b..b5d8a0602d6e39636636b0ba8526565fdf3cf212 100644 --- a/views/hr_timesheet.xml +++ b/views/hr_timesheet.xml @@ -17,13 +17,16 @@ <attribute name="string">Code activité UR</attribute> </field> <field name="project_id" position="after" > - <field name="cgscop_timesheet_code_id" readonly="1" class="td-ellipsis"/> - <field name="partner_id" domain="[('is_company', '=', True)]" class="td-ellipsis" /> + <field name="partner_id" domain="[('is_company', '=', True)]" required="True" class="td-ellipsis" /> <field name="name" class="td-minwidth" /> - <field name="ur_financial_system_id" options="{'no_create_edit': True}"/> </field> - <field name="task_id" position="replace"/> + <field name="task_id" position="attributes"> + <attribute name="invisible">True</attribute> + </field> <field name="unit_amount" widget="timesheet_uom" sum="Total"/> + <field name="unit_amount" position="after"> + <field name="ur_financial_system_id" options="{'no_create_edit': True}"/> + </field> </field> </record> @@ -34,7 +37,7 @@ <field name="model">account.analytic.line</field> <field name="arch" type="xml"> <pivot string="Rapport"> - <field name="project_id" type="row"/> + <field name="project_id" type="row" string="Code activité UR" /> <field name="date" type="col"/> <field name="unit_amount" type="measure"/> </pivot> diff --git a/views/hr_timesheet_cgscop.xml b/views/hr_timesheet_cgscop.xml index f6ef5e962383be58c74ac6554bef147b06f4e1e2..ceb4682607e077b2756429354e15916dd3ef711f 100644 --- a/views/hr_timesheet_cgscop.xml +++ b/views/hr_timesheet_cgscop.xml @@ -150,7 +150,7 @@ action="act_cgscop_project_timesheet" id="menu_action_project_lines_tree" sequence="35" - groups="analytic.group_analytic_accounting"/> + groups="cgscop_partner.group_ur_list_modif,cgscop_partner.group_cg_administrator"/> </data> </odoo> \ No newline at end of file diff --git a/views/res_partner.xml b/views/res_partner.xml new file mode 100644 index 0000000000000000000000000000000000000000..1e698616c408787b8d0a329ec8dcac3509316753 --- /dev/null +++ b/views/res_partner.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- Copyright 2019 Le Filament + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> + +<odoo> + <data> + + <!-- Tree View Timesheet CG --> + <record id="view_cgscop_hr_timesheet_account_inherit" model="ir.ui.view"> + <field name="name">res.partner.cgscop.timesheet.account.inherit</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="account.view_partner_property_form"/> + <field name="arch" type="xml"> + <page name="accounting" position="attributes"> + <attribute name="invisible">True</attribute> + </page> + </field> + </record> + + </data> +</odoo> \ No newline at end of file diff --git a/views/ur_financial_system.xml b/views/ur_financial_system.xml new file mode 100644 index 0000000000000000000000000000000000000000..698637534ae002ea6af02f6c388b09abd9446e66 --- /dev/null +++ b/views/ur_financial_system.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- Copyright 2019 Le Filament + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> + +<odoo> + <data> + <record id="view_ur_financial_system_tree" model="ir.ui.view"> + <field name="name">ur.financial.system.tree</field> + <field name="model">ur.financial.system</field> + <field name="arch" type="xml"> + <tree editable='top'> + <field name="name" /> + <field name="company_id" groups="base.group_no_one" /> + </tree> + </field> + </record> + + <record id="action_ur_financial_system" model="ir.actions.act_window"> + <field name="name">Dispositifs financiers</field> + <field name="res_model">ur.financial.system</field> + <field name="view_mode">tree</field> + </record> + + <menuitem id="menu_ur_financial_system" + name="Dispositifs financiers" + parent="hr_timesheet.hr_timesheet_menu_configuration" + action="action_ur_financial_system" + sequence="45" + groups="cgscop_partner.group_ur_list_modif"/> + + </data> +</odoo> \ No newline at end of file