addons-cm/purchase_collective/views/purchase_collective.xml
santiky 4abeea64a5
wip purchase_collective.
ToDo: Plantillas de correo, crear picking por supplier
2022-03-24 09:02:45 +01:00

111 lines
7.9 KiB
XML

<odoo>
<data noupdate="0">
<record id="purchase_collective_order_form_view" model="ir.ui.view">
<field name="name">purchase.collective.order.form.view</field>
<field name="model">purchase_collective.order</field>
<field name="arch" type="xml">
<form string="Collective Purchase Order">
<header>
<button name="action_rfq_send" states="draft" string="Send by Email" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
<button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="button_confirm" type="object" states="sent" string="Confirm Order" class="oe_highlight" id="bid_confirm"/>
<button name="button_approve" type="object" states='to approve' string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="action_view_invoice" string="Create Bill" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"/>
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}"/>
<button name="print_quotation" string="Print RFQ" type="object" states="sent" groups="base.group_user"/>
<button name="button_confirm" type="object" states="draft" string="Confirm Order" id="draft_confirm"/>
<button name="action_rfq_send" states="purchase" string="Send PO by Email" type="object" context="{'send_rfq':False}"/>
<button name="action_view_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'not in', ('no', 'invoiced'))]}"/>
<button name="button_draft" states="cancel" string="Set to Draft" type="object" />
<button name="button_cancel" states="draft,to approve,sent,purchase" string="Cancel" type="object" />
<button name="button_done" type="object" string="Lock" states="purchase"/>
<button name="button_unlock" type="object" string="Unlock" states="done" groups="purchase.group_purchase_manager"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,purchase" readonly="1"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button type="object" name="action_view_invoice"
class="oe_stat_button"
icon="fa-pencil-square-o" attrs="{'invisible':['|', ('invoice_count', '=', 0), ('state', 'in', ('draft','sent','to approve'))]}">
<field name="invoice_count" widget="statinfo" string="Vendor Bills"/>
<field name='invoice_ids' invisible="1"/>
</button>
</div>
<div class="oe_title">
<span class="o_form_label" attrs="{'invisible': [('state','not in',('draft','sent'))]}">Request for Quotation </span>
<span class="o_form_label" attrs="{'invisible': [('state','in',('draft','sent'))]}">Purchase Order </span>
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="partner_id" widget="res_partner_many2one" context="{'search_default_supplier':1, 'default_supplier':1, 'default_customer':0, 'show_vat': True}" domain="[('supplier','=',True)]"
placeholder="Name, TIN, Email, or Reference"
/>
<field name="partner_ref"/>
<field name="currency_id" groups="base.group_multi_currency" force_save="1"/>
<field name="deadline_date" attrs="{'required': True}" />
<field name="qty_min" attrs="{'required': True }" />
<field name="wh_id"/>
</group>
<group>
<field name="date_order"/>
<field name="origin" attrs="{'invisible': [('origin','=',False)]}"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
</group>
<notebook>
<page string="Pedidos de ventas">
<field name="sales_order_lines">
<tree string="Collective Purchase Order Lines" editable="bottom">
<field name="name"/>
<field name="partner_id" string="Customer"/>
<field name="state" invisible='0'/>
<field name="amount_total"/>
<!--
<button name="button_manual_payment" string="Manual Payment" type="object"
context="{'purchase_collective_line' : True, 'order_line_id': id, 'create_uid' : create_uid}"
states="draft"
/>
-->
</tree>
</field>
</page>
<page string="Other Information" name="purchase_delivery_invoice">
<group>
<group>
<label for="date_planned"/>
<div>
<!-- Expected to be readonly at creation otherwise recompute will change the value anyway -->
<field name="date_planned" attrs="{'readonly': ['|', ('id', '=', False), ('state', 'not in', ('draft', 'sent'))]}"/>
<button name="action_set_date_planned" type="object"
states="draft,sent"
string="Set date to all order lines"
help="This changes the scheduled date of all order lines to the given date"
class="fa fa-calendar o_icon_button oe_edit_only"/>
</div>
</group>
<group>
<field name="user_id"/>
<field name="invoice_status"/>
<field name="payment_term_id" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/>
<field name="fiscal_position_id" options="{'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/>
<field name="date_approve" groups="base.group_no_one"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
</data>
</odoo>