odex25_standard/odex25_purchase/odex25_purchase_coc/views/views.xml

229 lines
11 KiB
XML

<odoo>
<data>
<!-- purchase.order inherit form view -->
<record id="view_id" model="ir.ui.view">
<field name="name">purchase.order.inherit.view.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_view_invoice']" position="after">
<button type="object" name="action_view_coc" class="oe_stat_button" icon="fa-check"
attrs="{'invisible':['|',('state', 'in', ('draft','sent','to approve')),('coc_count','=', 0)]}">
<field name="coc_count" widget="statinfo" string="CoCs" help="Certificates of Completion"/>
<field name="coc_ids" invisible="1"/>
</button>
</xpath>
<xpath expr="//field[@name='company_id']" position="after">
<!-- <field name="need_coc"/> -->
<!-- <field name="coc_id" readonly="1"/> -->
<field name="coc_created" invisible="1"/>
<field name="is_manual_receipt_user" invisible="1"/>
</xpath>
<xpath expr="//field[@name='order_line']//field[@name='qty_received']" position="attributes">
<attribute name="attrs">
{
'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))],
'readonly': ['|',
('qty_received_method', '!=', 'manual'),
('parent.is_manual_receipt_user', '=', False)
]
}
</attribute>
</xpath>
</field>
</record>
<!-- purchase.coc form view -->
<record id="purchase_coc_form" model="ir.ui.view">
<field name="name">purchase.coc.view.form</field>
<field name="model">purchase.coc</field>
<field name="arch" type="xml">
<form string="" create="false" delete="false">
<header>
<button name="action_confirm" type="object" class="btn-primary" states="draft" string="Confirm"
groups="odex25_purchase_coc.group_coc_user,odex25_purchase_coc.group_coc_manager" icon="fa-check-circle"/>
<button name="action_cancel" type="object" class="btn-danger" states="draft" string="Reject"
groups="odex25_purchase_coc.group_coc_manager" icon="fa-times-circle"/>
<button name="action_approve"
type="object"
string="Manager Approve"
states="manager"
class="btn-primary" icon="fa-check-circle"
groups="odex25_purchase_coc.group_purchase_coc_direct_manager"
/>
<button name="action_manager_reject"
type="object"
string="Manager Reject"
states="manager"
class="btn-danger" icon="fa-times-circle"
groups="odex25_purchase_coc.group_purchase_coc_direct_manager"
/>
<button name="action_draft" type="object" class="btn-secondary" states="cancel" string="Set to Draft" icon="fa-undo"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="get_attachments"
type="object"
class="oe_stat_button"
icon="fa-file-text-o">
<field name="attach_no" widget="statinfo" string="Documents"/>
</button>
</div>
<group col="2">
<group>
<field name="po_id" readonly="1"/>
<field name="date" readonly="1"/>
<field name="tender_name"/>
<field name="parent_coc_id" readonly="1"/>
</group>
<group>
<field name="vendor_id" readonly="1"/>
<field name="coc_stage" attrs="{'readonly': [('state', '=', 'approve')]}"/>
<field name="receiving_meth" attrs="{'readonly': [('state', '=', 'approve')]}"/>
<field name="work_done_scope"
widget="radio"
options="{'horizontal': true}"
attrs="{'readonly': [('state', '=', 'approve')]}"/>
<field name="work_done_scope_reason"
attrs="{
'readonly': [('state', '=', 'approve')],
'invisible': [('work_done_scope', '!=', 'no')],
'required': [('work_done_scope', '=', 'no')]
}"/>
<field name="work_acceptable"
widget="radio"
options="{'horizontal': true}"
attrs="{'readonly': [('state', '=', 'approve')]}"/>
<field name="work_acceptable_reason"
attrs="{
'readonly': [('state', '=', 'approve')],
'invisible': [('work_acceptable', '!=', 'no')],
'required': [('work_acceptable', '=', 'no')]
}"/>
<field name="on_time"
widget="radio"
options="{'horizontal': true}"
attrs="{'readonly': [('state', '=', 'approve')]}"/>
<field name="delay_days"
attrs="{
'readonly': [('state', '=', 'approve')],
'invisible': [('on_time', '!=', 'no')],
'required': [('on_time', '=', 'no')]
}"/>
<field name="delay_reason"
attrs="{
'readonly': [('state', '=', 'approve')],
'invisible': [('on_time', '!=', 'no')],
'required': [('on_time', '=', 'no')]
}"/>
</group>
</group>
<notebook>
<page string="Products" name="products">
<field name="coc_line_ids" attrs="{'readonly': [('state', '=', 'approve')]}">
<tree editable="bottom" create="false" delete="false"
decoration-success="qty_to_receive > 0"
decoration-muted="qty_remaining == 0">
<field name="product_id" readonly="1" width="20"/>
<field name="name" readonly="1" width="20"/>
<field name="qty_ordered" readonly="1" width="20" string="Total Ordered"/>
<field name="product_uom" width="20" readonly="1"/>
<field name="qty_received_total" readonly="1" width="20" string="Previously Received"/>
<!-- <field name="product_qty" readonly="1" width="20" string="Current Order Qty"/>-->
<field name="qty_remaining" readonly="1" width="20" string="Remaining"/>
<field name="show_percentage" invisible="1"/>
<field name="qty_percentage" width="40"
attrs="{'column_invisible': [('parent.receiving_meth', '!=', 'percentage')],
'readonly': [('qty_remaining', '=', 0)]}"
string="%"/>
<field name="qty_to_receive" width="20"
string="Qty to Receive"
attrs="{'column_invisible': [('parent.receiving_meth', '=', 'percentage')],
'readonly': [('qty_remaining', '=', 0)]}"
/>
<field name="date_planned" width="20" attrs="{'readonly': [('parent.state', '=', 'approve')]}" />
<field name="price_unit" width="20" readonly="1"/>
<field name="sub_price_total" width="20" readonly="1"/>
<field name="po_line_id" invisible="1"/>
<field name="receiving_meth" invisible="1"/>
</tree>
</field>
</page>
<page string="Note" name="note">
<field name="note"/>
</page>
</notebook>
<!-- Add the chatter below -->
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- purchase.coc tree view -->
<record id="purchase_coc_view_tree" model="ir.ui.view">
<field name="name">model.name.view.tree</field>
<field name="model">purchase.coc</field>
<field name="arch" type="xml">
<tree create="false" delete="false" edit="false">
<field name="name"/>
<field name="po_id"/>
<field name="date"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- purchase.coc action window -->
<record id="purchase_coc_action" model="ir.actions.act_window">
<field name="name">Certificate of Completion</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.coc</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Approve and Confirm CoC
</p>
</field>
</record>
<!-- This Menu Item must have a parent and an action -->
<menuitem id="coc_menu" name="Certificat of Completion CoC" parent="purchase.menu_purchase_root"
action="purchase_coc_action" groups="group_coc_menu" sequence="3"/>
</data>
</odoo>