~tempo-openerp/+junk/axima_stock

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
	<!-- Add margin rate to existing view -->
    <record model="ir.ui.view" id="sale_margin_rate_sale_order">
        <field name="name">sale.order.margin_rate.view.form</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale_margin.sale_margin_sale_order"/>
        <field name="arch" type="xml">
            <xpath expr="//group[@name='sale_margin_grp']/field[@name='margin']"
            		position="after">
                <field name="margin_rate" widget='percent' groups="base.group_user"/>
                <field name="kg" />
            </xpath>
        </field>
    </record>
    
    <!--
    AX-50 purchase price before unit price for sale order lines tree edit
    in default sale_margin module unit price is before purchase price
    -->
    <record model="ir.ui.view" id="axima_sale_margin_sale_order_line_form">
        <field name="name">sale.order.line.tree.margin.view.form</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale_margin.sale_margin_sale_order_line_form"/>
        <field name="arch" type="xml">
           <xpath expr="//tree[@string='Sales Order Lines']" position="replace" >
                <tree string="Sales Order Lines" editable="bottom">
                    <field name="sequence" widget="handle"/>
                    <field name="state" invisible="1"/>
                    <field name="th_weight" invisible="1"/>
                    <field name="product_id"
                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
                        groups="base.group_user" 
                        on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name, parent.partner_id, False, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
                    <field name="name"/>
                    <field name="product_uom_qty"
                        context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
                        on_change="product_id_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, False, parent.fiscal_position, True, context)"/>
                    <field name="product_uom"
                        on_change="product_uom_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, product_uos, name, parent.partner_id, False, False, parent.date_order, context)"
                        groups="product.group_uom" options='{"no_open": True}'/>
                    <field name="product_uos_qty" groups="product.group_uos" invisible="1"/>
                    <field name="product_uos" string="UoS" groups="product.group_uos" invisible="1"/>
                    <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"/>
                    <field name="purchase_price" groups="base.group_user" string="Prix d'achat" />
                    <field name="price_unit" on_change="onchange_discount(price_unit, discount)" string="Prix de vente" />
                    <field name="discount" groups="sale.group_discount_per_so_line" onchange="onchange_discount(price_unit, discount)"/>
                    <field name="discount_price" />
                    <field name="price_subtotal"/>
                </tree>
            </xpath>
        </field>
    </record>
</data>
</openerp>