openerp-construction-core-editors team mailing list archive
-
openerp-construction-core-editors team
-
Mailing list archive
-
Message #00000
[Merge] lp:~v-jadav-serpentcs/openerp-construction/7.0 into lp:openerp-construction
Serpent Consulting Services has proposed merging lp:~v-jadav-serpentcs/openerp-construction/7.0 into lp:openerp-construction.
Requested reviews:
OpenERP Construction Core Editors (openerp-construction-core-editors)
For more details, see:
https://code.launchpad.net/~v-jadav-serpentcs/openerp-construction/7.0/+merge/176003
--
https://code.launchpad.net/~v-jadav-serpentcs/openerp-construction/7.0/+merge/176003
Your team OpenERP Construction Core Editors is requested to review the proposed merge of lp:~v-jadav-serpentcs/openerp-construction/7.0 into lp:openerp-construction.
=== modified file 'sale_insulation/__openerp__.py'
--- sale_insulation/__openerp__.py 2012-06-20 22:01:03 +0000
+++ sale_insulation/__openerp__.py 2013-07-20 12:42:24 +0000
@@ -31,7 +31,7 @@
for insulation products.
""",
"depends" : [
- "sale",
+ "sale_stock",
"product_insulation",
"procurement_insulation",
"stock_picking_delivery_insulation",
=== modified file 'sale_insulation/sale_insulation.py'
--- sale_insulation/sale_insulation.py 2012-07-31 19:50:48 +0000
+++ sale_insulation/sale_insulation.py 2013-07-20 12:42:24 +0000
@@ -26,7 +26,6 @@
from tools.translate import _
class sale_order(osv.osv):
- _name = 'sale.order'
_inherit = 'sale.order'
def _amount_line_tax(self, cr, uid, line, context=None):
@@ -65,12 +64,10 @@
res['surface'] = line.surface
return res
-
sale_order()
class sale_order_line(osv.osv):
- _name = 'sale.order.line'
_inherit = 'sale.order.line'
def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
@@ -123,7 +120,7 @@
}
def create(self, cr, uid, vals, context=None):
- if vals['product_sprayfoam']:
+ if 'product_sprayfoam' in vals:
try:
vals.update({
'product_uos_qty': vals['surface'] * vals['rvalue'] / vals['product_rvalue']
@@ -131,7 +128,7 @@
except ZeroDivisionError:
pass
else:
- if vals['product_insulation']:
+ if 'product_insulation' in vals:
vals.update({
'surface': vals['product_uos_qty']
})
@@ -218,8 +215,8 @@
uos = False
else:
uos = False
- if product_obj.description_sale:
- result['notes'] = product_obj.description_sale
+# if product_obj.description_sale:
+# result['notes'] = product_obj.description_sale
fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False
if update_tax: #The quantity only have changed
result['delay'] = (product_obj.sale_delay or 0.0)
@@ -324,8 +321,7 @@
if line.product_uos:
return line.product_uos_qty or 0.0
return line.product_uom_qty
- else:
- return self.pool.get('procurement.order').quantity_get(cr, uid,
+ return self.pool.get('procurement.order').quantity_get(cr, uid,
line.procurement_id.id, context=context)
def _get_line_uom(line):
@@ -373,7 +369,7 @@
'uos_id': uos_id,
'product_id': line.product_id.id or False,
'invoice_line_tax_id': [(6, 0, [x.id for x in line.tax_id])],
- 'note': line.notes,
+ #'note': line.notes, Note fields are not available in 7.0
'account_analytic_id': line.order_id.project_id and line.order_id.project_id.id or False,
'rvalue': line.rvalue,
'surface': line.surface,
=== modified file 'sale_insulation/sale_insulation_view.xml'
--- sale_insulation/sale_insulation_view.xml 2012-06-20 22:01:03 +0000
+++ sale_insulation/sale_insulation_view.xml 2013-07-20 12:42:24 +0000
@@ -1,111 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
- <data>
- <record id="view_sale_order_insulation" model="ir.ui.view">
- <field name="name">sale.order.form.insulation</field>
- <field name="model">sale.order</field>
- <field name="inherit_id" ref="sale.view_order_form"/>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <data>
-
- <xpath
- expr="//field[@name='order_line']/tree[@string='Sales Order Lines']"
- position="replace">
- <tree string="Sales Order Lines">
- <field colspan="4" name="name"/>
- <field name="surface"/>
- <field name="rvalue"/>
- <field groups="product.group_uos" name="product_uos_qty" string="Qty(UoS)"/>
- <field groups="product.group_uos" name="product_uos" string="UoS"/>
- <field name="price_unit"/>
- <field name="product_uom_qty" string="Qty(UoM)"/>
- <field name="product_uom" string="UoM"/>
- <field name="price_subtotal"/>
- </tree>
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='product_uos_qty']"
- position="replace">
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='product_uos']"
- position="replace">
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='product_uom_qty']"
- position="replace">
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='product_uom']"
- position="replace">
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='name']"
- position="after">
- <field name="product_rvalue" invisible="True"/>
- <field name="product_insulation" invisible="True"/>
- <field name="product_sprayfoam" invisible="True" />
- <field name="surface" on_change="surface_or_rvalue_change(surface, rvalue, product_rvalue, product_id, context)" attrs="{'invisible':[('product_sprayfoam', '=', False)]}"/>
- <newline/>
- <field name="rvalue" on_change="surface_or_rvalue_change(surface, rvalue, product_rvalue, product_id, context)" attrs="{'invisible':[('product_insulation', '=', False)]} "/>
- <newline/>
- <field groups="product.group_uos" name="product_uos_qty" attrs="{'readonly':[('product_sprayfoam', '==', True)]}" on_change="uos_change(product_uos, product_uos_qty, product_id)"/>
- <field groups="product.group_uos" name="product_uos" nolabel="1" on_change="uos_change(product_uos, product_uos_qty, product_id)"/>
- <newline/>
- <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, product_packaging, parent.fiscal_position, True, context)"
- attrs="{'invisible':[('product_insulation','=',True)]}"/>
- <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)"
- nolabel="1"
- attrs="{'invisible':[('product_insulation','=',True)]}"/>
- <newline/>
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='discount']"
- position="replace">
- <field name="discount" invisible="True"/>
- </xpath>
-
- <xpath
- expr="//field[@name='order_line']/form/notebook/page/group/field[@name='product_packaging']"
- position="replace">
- <field name="product_packaging" invisible="True"/>
- </xpath>
-
- <xpath
- expr="//button[@string='Print Quotation']"
- position="replace">
- <button
- name="%(report_sale_order_quotation)d"
- string="Print Quotation"
- type="action"
- icon="gtk-print"
- states="draft"/>
- </xpath>
- <xpath
- expr="//button[@string='Print Order']"
- position="replace">
- <button
- name="%(report_sale_order_quotation)d"
- string="Print Order"
- type="action"
- icon="gtk-print"
- states="waiting_date,manual,progress,done,shipping_except,invoice_except"/>
- </xpath>
-
-
-
- </data>
- </field>
- </record>
- </data>
+ <data>
+ <record id="view_sale_order_insulation" model="ir.ui.view">
+ <field name="name">sale.order.form.insulation</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+
+ <xpath
+ expr="//field[@name='order_line']/tree[@string='Sales Order Lines']"
+ position="replace">
+ <tree string="Sales Order Lines" editable="bottom">
+ <field colspan="4" name="name" />
+ <field name="sequence" widget="handle"/>
+ <field name="state" invisible="1"/>
+ <field name="th_weight" invisible="1"/>
+ <field name="surface" />
+ <field name="rvalue" />
+ <field groups="product.group_uos" name="product_uos_qty"
+ string="Qty(UoS)" />
+ <field groups="product.group_uos" name="product_uos"
+ string="UoS" />
+ <field name="price_unit" />
+ <field name="product_uom_qty" string="Qty(UoM)" />
+ <field name="product_uom" string="UoM" />
+ <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
+ <field name="price_subtotal" />
+ </tree>
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/div/field[@name='product_uos_qty']"
+ position="replace">
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/div/field[@name='product_uos']"
+ position="replace">
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/div/field[@name='product_uom_qty']"
+ position="replace">
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/div/field[@name='product_uom']"
+ position="replace">
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/field[@name='name']"
+ position="after">
+ <field name="product_rvalue" invisible="True" />
+ <field name="product_insulation" invisible="True" />
+ <field name="product_sprayfoam" invisible="True" />
+ <field name="surface"
+ on_change="surface_or_rvalue_change(surface, rvalue, product_rvalue, product_id, context)"
+ attrs="{'invisible':[('product_sprayfoam', '=', False)]}" />
+ <newline />
+ <field name="rvalue"
+ on_change="surface_or_rvalue_change(surface, rvalue, product_rvalue, product_id, context)"
+ attrs="{'invisible':[('product_insulation', '=', False)]} " />
+ <newline />
+ <field groups="product.group_uos" name="product_uos_qty"
+ attrs="{'readonly':[('product_sprayfoam', '==', True)]}"
+ on_change="uos_change(product_uos, product_uos_qty, product_id)" />
+ <field groups="product.group_uos" name="product_uos"
+ nolabel="1" on_change="uos_change(product_uos, product_uos_qty, product_id)" />
+ <newline />
+ <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, product_packaging, parent.fiscal_position, True, context)"
+ attrs="{'invisible':[('product_insulation','=',True)]}" />
+ <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)"
+ nolabel="1" attrs="{'invisible':[('product_insulation','=',True)]}" />
+ <newline />
+ </xpath>
+
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/div/field[@name='discount']"
+ position="replace">
+ <field name="discount" invisible="True" />
+ </xpath>
+
+ <xpath expr="//button[@string='Print']" position="replace">
+ <button name="%(report_sale_order_quotation)d" string="Print Quotation"
+ type="action" icon="gtk-print" states="draft" />
+ </xpath>
+ <xpath expr="//button[@string='Print']" position="replace">
+ <button name="%(report_sale_order_quotation)d" string="Print Order"
+ type="action" icon="gtk-print"
+ states="waiting_date,manual,progress,done,shipping_except,invoice_except" />
+ </xpath>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="view_sale_stock_order_insulation" model="ir.ui.view">
+ <field name="name">sale.order.form.insulation1</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale_stock.view_order_form_inherit" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath
+ expr="//field[@name='order_line']/form/group/group/field[@name='product_packaging']"
+ position="attributes">
+ <attribute name="invisible">1</attribute>
+ </xpath>
+ </data>
+ </field>
+ </record>
+ </data>
</openerp>
Follow ups