<menuitem id="menu_purchase_config_purchase" name="Configuration"
groups="group_purchase_manager"
parent="base.menu_purchase_root" sequence="100"/>
- <menuitem
- action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
- parent="menu_purchase_config_purchase" sequence="10" groups="product.group_purchase_pricelist" />
<record id="purchase_pricelist_version_action" model="ir.actions.act_window">
<field name="name">Pricelist Versions</field>
<menuitem
id="menu_purchase_config_pricelist" name="Pricelists"
parent="menu_purchase_config_purchase" sequence="50" groups="product.group_purchase_pricelist"/>
+ <menuitem
+ action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
+ parent="menu_purchase_config_pricelist" sequence="1" groups="product.group_purchase_pricelist" />
+
+ <menuitem
+ action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
+ parent="menu_purchase_config_pricelist" sequence="1" groups="product.group_purchase_pricelist" />
<menuitem
action="purchase_pricelist_version_action" id="menu_purchase_pricelist_version_action"
parent="menu_purchase_config_pricelist" sequence="2" groups="product.group_purchase_pricelist"/>
-
<menuitem
action="product.product_price_type_action" id="menu_product_pricelist_action2_purchase_type"
parent="menu_purchase_config_purchase"/>
<menuitem
- action="base.action_partner_category_form" id="menu_partner_categories_in_form" name="Partner Categories"
+ action="base.action_partner_category_form" id="menu_partner_categories_in_form" name="Partner Tags"
parent="purchase.menu_purchase_partner_cat" groups="base.group_no_one"/>
<!--Supplier menu-->
<button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
<button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
- <button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
- <button name="purchase_cancel" states="draft,confirmed,sent" string="Cancel Order"/>
+ <button name="action_cancel_draft" states="cancel,confirmed" string="Set to Draft" type="object" />
+ <button name="purchase_cancel" states="draft,confirmed,sent" string="Cancel"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue"}' readonly="1"/>
</header>
<sheet>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" domain="[('supplier','=',True)]"/>
<field name="partner_ref"/>
<field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
- <field name="currency_id" invisible='1'/>
+ <field name="currency_id" groups="base.group_multi_currency"/>
<field name="journal_id" invisible='1'/>
</group>
<group>
<field name="date_order"/>
- <field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
+ <field name="origin" attrs="{'invisible': [('origin','=',False)]}"/>
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<page string="Purchase Order">
<field name="order_line">
<tree string="Purchase Order Lines" editable="bottom">
- <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
+ <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
<field name="name"/>
<field name="date_planned"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="payment_term_id" widget="selection"/>
<field name="fiscal_position" attrs="{'readonly': [('invoiced','=', True)]}" />
<!-- We do not need these fields anymore, the information is in open chatter -->
- <field name="validator" groups="base.group_no_one" context="{'default_groups_ref': ['purchase.group_purchase_user', 'account.group_account_invoice']}"/>
+ <field name="validator" groups="base.group_no_one"/>
<field name="date_approve" groups="base.group_no_one"/>
</group>
</group>
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/>
<separator/>
<filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
- <field name="partner_id"/>
+ <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="product_id"/>
<field name="create_uid"/>
<group expand="0" string="Group By...">
<field name="name" string="Reference"/>
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
- <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
+ <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','in',('draft','sent'))]" help="Purchase orders that haven't yet been confirmed"/>
<filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
<filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
<separator/>
<filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
- <field name="partner_id"/>
+ <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="product_id"/>
<field name="create_uid"/>
<group expand="0" string="Group By...">
<filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
- <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
- <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
+ <filter string="Order Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
+ <filter string="Expected Month" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
</group>
</search>
</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="context">{}</field>
- <field name="domain">[('state','in',('draft','sent','cancel'))]</field>
+ <field name="domain">[('state','in',('draft','sent','cancel', 'confirmed'))]</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="search_view_id" ref="view_purchase_order_filter"/>
<field name="help" type="html">
<sheet>
<group>
<group>
- <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
+ <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,False,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
<label for="product_qty"/>
<div>
<field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)" class="oe_inline"/>
<search string="Search Purchase Order">
<field name="order_id"/>
<field name="product_id"/>
- <field name="partner_id" string="Supplier"/>
+ <field name="partner_id" string="Supplier" filter_domain="[('partner_id', 'child_of', self)]"/>
<group expand="0" string="Group By...">
<filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="options" position="inside">
- <field name="purchase_ok"/>
+ <field name="purchase_ok" attrs="{'readonly': [('is_only_child', '=', False)]}"/>
<label for="purchase_ok"/>
</div>
<group name="procurement" position="after">
</field>
</record>
+ <record id="product_template_search_view_purchase" model="ir.ui.view">
+ <field name="name">product.template.search.purchase</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_search_view"/>
+ <field name="arch" type="xml">
+ <filter name="filter_to_sell" position="after">
+ <filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
+ </filter>
+ </field>
+ </record>
+
<record id="view_template_purchase_ok_form" model="ir.ui.view">
<field name="name">product.template.purchase.ok.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
- <field name="sale_ok" position="after">
+ <div name="options" position="inside">
<field name="purchase_ok"/>
- </field>
+ <label for="purchase_ok"/>
+ </div>
</field>
</record>
<record model="ir.actions.act_window" id="action_purchase_line_product_tree">
<xpath expr="//div[@name='buttons']" position="inside">
<button string="Purchases" name="%(action_purchase_line_product_tree)d" type="action" groups="purchase.group_purchase_user"/>
</xpath>
- <xpath expr="//field[@name='property_account_expense']" position="replace" >
+ <field name="property_account_expense" position="replace" >
<field name="property_account_expense" domain="[('type','<>','view'),('type','<>','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" groups="account.group_account_user"/>
- </xpath>
- <xpath expr="//field[@name='supplier_taxes_id']" position="replace" >
+ </field>
+ <field name='supplier_taxes_id' position="replace" >
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
- </xpath>
+ </field>
</field>
</record>
</data>