Purpose of this commit to improve generic usage of project app. So in this commit done following changes: - add the following filters for project.update search view - display 'due mm/dd/yyyy' in red if the deadline is in the past and the milestone hasn't been reached yet for milestone section - add an 'x Milestones' stat button that should open a list view of all of the Milestones that are linked to an SOL of this SO for sale.order form view - add an 'unread messages' filter with separated from other filter - rename 'create' into 'create project for project wizard - change to "Create projects to organise your tasks. Define a different workflow for each project." for project.project action helper task-2864875 closes odoo/odoo#94936 Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
221 lines
12 KiB
XML
221 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="project_project_view_inherit_project_filter" model="ir.ui.view">
|
|
<field name="name">project.project.select.inherit.project</field>
|
|
<field name="model">project.project</field>
|
|
<field name="inherit_id" ref="project.view_project_project_filter"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='partner_id']" position="after">
|
|
<field name="sale_order_id"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_project_view_tree_inherit_sale_project" model="ir.ui.view">
|
|
<field name="name">project.project.tree.inherit.sale.project</field>
|
|
<field name="model">project.project</field>
|
|
<field name="inherit_id" ref="project.view_project"/>
|
|
<field name="priority">50</field>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='partner_id']" position="after">
|
|
<field name="sale_line_id" optional="hide" readonly="1"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_edit_project_inherit_form" model="ir.ui.view">
|
|
<field name="name">project.project.view.inherit</field>
|
|
<field name="model">project.project</field>
|
|
<field name="inherit_id" ref="project.edit_project"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//header" position="inside">
|
|
<field name="has_any_so_to_invoice" invisible="1"/>
|
|
<field name="has_any_so_with_nothing_to_invoice" invisible="1"/>
|
|
<button name="action_create_invoice" string="Create Invoice" type="object" class="btn-primary" groups="sales_team.group_sale_salesman_all_leads" attrs="{'invisible': [('has_any_so_to_invoice', '=', False)]}" data-hotkey="w"/>
|
|
<button name="action_create_invoice" string="Create Invoice" type="object" class="btn-secondary" groups="sales_team.group_sale_salesman_all_leads" attrs="{'invisible': ['|', ('has_any_so_with_nothing_to_invoice', '=', False), ('has_any_so_to_invoice', '=', True)]}" data-hotkey="w"/>
|
|
</xpath>
|
|
<xpath expr="//button[@name='project_update_all_action']" position="after">
|
|
<button class="oe_stat_button"
|
|
type="object" name="action_view_sos" icon="fa-dollar"
|
|
attrs="{'invisible': ['|', ('allow_billable', '=', False), ('sale_order_count', '=', 0)]}"
|
|
groups="sales_team.group_sale_salesman_all_leads">
|
|
<field name="sale_order_count" widget="statinfo" string="Sales Orders"/>
|
|
</button>
|
|
</xpath>
|
|
<xpath expr="//field[@name='partner_id']" position="attributes">
|
|
<attribute name="options">{'always_reload': True}</attribute>
|
|
<attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
|
|
</xpath>
|
|
<xpath expr="//div[@id='rating_settings']" position="before">
|
|
<div class="col-lg-6 o_setting_box" id="allow_billable_container">
|
|
<div class="o_setting_left_pane">
|
|
<field name="allow_billable"/>
|
|
</div>
|
|
<div class="o_setting_right_pane">
|
|
<label for="allow_billable"/>
|
|
<div class="text-muted" id="allow_billable_setting">
|
|
Invoice your time and material to customers
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</xpath>
|
|
<xpath expr="//button[@name='action_view_analytic_account_entries']" position="after">
|
|
<button name="action_open_project_invoices" type="object" class="oe_stat_button" icon="fa-pencil-square-o"
|
|
attrs="{'invisible': ['|', ('invoice_count', '=', 0), ('analytic_account_id', '=', False)]}"
|
|
groups="account.group_account_readonly">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value">
|
|
<field name="invoice_count" nolabel="1"/>
|
|
</span>
|
|
<span class="o_stat_text">
|
|
Invoices
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</xpath>
|
|
<xpath expr="//button[@name='action_view_analytic_account_entries']" position="after">
|
|
<button name="action_open_project_vendor_bills" type="object" class="oe_stat_button" icon="fa-pencil-square-o" attrs="{'invisible': [('vendor_bill_count', '=', 0)]}" groups="account.group_account_readonly">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value">
|
|
<field name="vendor_bill_count" nolabel="1"/>
|
|
</span>
|
|
<span class="o_stat_text">
|
|
Vendor Bills
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
<record id="view_sale_project_inherit_form" model="ir.ui.view">
|
|
<field name="name">project.task.view.inherit</field>
|
|
<field name="model">project.task</field>
|
|
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
|
|
<field name="inherit_id" ref="project.view_task_form2"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//span[@id='start_rating_buttons']" position="before">
|
|
<button class="oe_stat_button"
|
|
type="object" name="action_view_so" icon="fa-dollar"
|
|
attrs="{'invisible': [('sale_order_id', '=', False)]}"
|
|
string="Sales Order"
|
|
groups="sales_team.group_sale_salesman_all_leads"/>
|
|
</xpath>
|
|
<xpath expr="//field[@name='partner_id']" position="attributes">
|
|
<attribute name="options">{'always_reload': True}</attribute>
|
|
<attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
|
|
</xpath>
|
|
<xpath expr="//field[@name='partner_phone']" position="after">
|
|
<field name="sale_order_id" attrs="{'invisible': True}" groups="sales_team.group_sale_salesman"/>
|
|
<field name="sale_line_id" string="Sales Order Item" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
|
|
<field name="commercial_partner_id" invisible="1" />
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_task_view_form_inherit_sale_line_editable" model="ir.ui.view">
|
|
<field name="name">project.task.form.inherit.sale.line.editable.salesman</field>
|
|
<field name="model">project.task</field>
|
|
<field name="inherit_id" ref="view_sale_project_inherit_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='sale_line_id']" position="attributes">
|
|
<attribute name="options">{"no_create": True}</attribute>
|
|
<attribute name="readonly">0</attribute>
|
|
</xpath>
|
|
</field>
|
|
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
|
|
</record>
|
|
|
|
<record id="project_task_view_search" model="ir.ui.view">
|
|
<field name="name">project.task.search.inherit</field>
|
|
<field name="model">project.task</field>
|
|
<field name="inherit_id" ref="project.view_task_search_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='partner_id']" position="after">
|
|
<field name="sale_order_id" string="Sale Order" filter_domain="['|', ('sale_order_id', 'ilike', self), ('sale_line_id', 'ilike', self)]"/>
|
|
</xpath>
|
|
<xpath expr="//search/group/filter[@name='customer']" position="after">
|
|
<filter string="Sales Order Item" name="sale_line_id" context="{'group_by': 'sale_line_id'}"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_milestone_view_form" model="ir.ui.view">
|
|
<field name="name">project.milestone.view.form.inherit</field>
|
|
<field name="model">project.milestone</field>
|
|
<field name="inherit_id" ref="project.project_milestone_view_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//group[@name='main_details']" position="after">
|
|
<field name="allow_billable" invisible="1"/>
|
|
<group attrs="{'invisible': [('allow_billable', '=', False)]}">
|
|
<field name="project_partner_id" invisible="1"/>
|
|
<field name="sale_line_id" options="{'no_open': True}" readonly="1"/>
|
|
<field name="quantity_percentage" widget="percentage" readonly="1"/>
|
|
</group>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_milestone_view_form_salesman" model="ir.ui.view">
|
|
<field name="name">project.milestone.view.form.inherit.salesman</field>
|
|
<field name="model">project.milestone</field>
|
|
<field name="inherit_id" ref="project_milestone_view_form"/>
|
|
<field name="groups_id" eval="[Command.link(ref('sales_team.group_sale_salesman'))]"/>
|
|
<field name="arch" type="xml">
|
|
<field name="sale_line_id" position="attributes">
|
|
<attribute name="options">{'no_create': True}</attribute>
|
|
<attribute name="readonly">0</attribute>
|
|
</field>
|
|
<field name="quantity_percentage" position="attributes">
|
|
<attribute name="readonly">0</attribute>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_milestone_view_tree" model="ir.ui.view">
|
|
<field name="name">project.milestone.view.tree.inherit</field>
|
|
<field name="model">project.milestone</field>
|
|
<field name="inherit_id" ref="project.project_milestone_view_tree"/>
|
|
<field name="mode">primary</field>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='name']" position="after">
|
|
<field name="project_partner_id" invisible="1"/>
|
|
<field name="allow_billable" invisible="1"/>
|
|
<field name="sale_line_id" optional="hide" options="{'no_open': True}" readonly="1"/>
|
|
<field name="quantity_percentage" optional="hide" widget="percentage" readonly="1"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="sale_project_milestone_view_tree" model="ir.ui.view">
|
|
<field name="name">project.milestone.view.tree.inherit</field>
|
|
<field name="model">project.milestone</field>
|
|
<field name="inherit_id" ref="sale_project.project_milestone_view_tree"/>
|
|
<field name="mode">primary</field>
|
|
<field name="arch" type="xml">
|
|
<field name="sale_line_id" position="attributes">
|
|
<attribute name="optional">show</attribute>
|
|
</field>
|
|
<field name="quantity_percentage" position="attributes">
|
|
<attribute name="optional">show</attribute>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="project_milestone_view_tree_salesman" model="ir.ui.view">
|
|
<field name="name">project.milestone.view.tree.inherit.salesman</field>
|
|
<field name="model">project.milestone</field>
|
|
<field name="inherit_id" ref="project_milestone_view_tree"/>
|
|
<field name="groups_id" eval="[Command.link(ref('sales_team.group_sale_salesman'))]"/>
|
|
<field name="arch" type="xml">
|
|
<field name="sale_line_id" position="attributes">
|
|
<attribute name="options">{'no_create': True}</attribute>
|
|
<attribute name="readonly">0</attribute>
|
|
</field>
|
|
<field name="quantity_percentage" position="attributes">
|
|
<attribute name="readonly">0</attribute>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
</odoo>
|