wip purchase_collective.
ToDo: Plantillas de correo, crear picking por supplier
This commit is contained in:
parent
d2ac963ee1
commit
4abeea64a5
13 changed files with 836 additions and 0 deletions
56
purchase_collective/views/actions.xml
Normal file
56
purchase_collective/views/actions.xml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="action_purchase_collective_order_open" model="ir.actions.act_window">
|
||||
<field name="name">Open</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase_collective.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{
|
||||
'search_default_my_sale_orders_filter': 1
|
||||
}
|
||||
</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new Collective Purchase.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_collective_order_confirmed" model="ir.actions.act_window">
|
||||
<field name="name">Closed</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase_collective.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{
|
||||
'search_default_my_sale_orders_filter': 1
|
||||
}
|
||||
</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new Collective Purchase.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_collective_order_cancel" model="ir.actions.act_window">
|
||||
<field name="name">Cancelled</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase_collective.order</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{
|
||||
'search_default_my_sale_orders_filter': 1
|
||||
}
|
||||
</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new Collective Purchase.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
31
purchase_collective/views/menus.xml
Normal file
31
purchase_collective/views/menus.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<odoo>
|
||||
<data>
|
||||
<!-- Top menu item -->
|
||||
<menuitem
|
||||
id="menu_collective_purchase_root"
|
||||
name="Collective Purchases"
|
||||
sequence="50"
|
||||
/>
|
||||
<!-- Submenu -->
|
||||
<menuitem id="menu_purchase_collective_sub"
|
||||
parent="purchase_collective.menu_collective_purchase_root"
|
||||
name ="Collective Purchases"
|
||||
sequence="5"
|
||||
/>
|
||||
<menuitem action="action_purchase_collective_order_open"
|
||||
id="menu_purchase_collective_order_open"
|
||||
parent="purchase_collective.menu_purchase_collective_sub"
|
||||
sequence="10"
|
||||
/>
|
||||
<menuitem action="action_purchase_collective_order_confirmed"
|
||||
id="menu_purchase_collective_order_confirmed"
|
||||
parent="purchase_collective.menu_purchase_collective_sub"
|
||||
sequence="20"
|
||||
/>
|
||||
<menuitem action="action_purchase_collective_order_cancel"
|
||||
id="menu_purchase_collective_order_cancelled"
|
||||
parent="purchase_collective.menu_purchase_collective_sub"
|
||||
sequence="30"
|
||||
/>
|
||||
</data>
|
||||
</odoo>
|
||||
111
purchase_collective/views/purchase_collective.xml
Normal file
111
purchase_collective/views/purchase_collective.xml
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<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>
|
||||
|
||||
18
purchase_collective/views/sale_order.xml
Normal file
18
purchase_collective/views/sale_order.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<record id="view_form_sale_order_cp" model="ir.ui.view">
|
||||
<field name="name">sale order collective purchase extension</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="before" >
|
||||
<group>
|
||||
<field name="is_cp" string="Is Collective Purchase" help="Is part o a collective Purchase" groups="purchase_collective.group_purchase_collective_manager"/>
|
||||
<field name="cp_order_id" string="Collective Purchase wich this order belogns" groups="purchase_collective.group_purchase_collective_manager"/>
|
||||
</group>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue