Renamed repair_module to mrp_repair : Created Workflow, Added functions for onchange, Added new views and Created Menu Items

bzr revid: ruchakpatel@gmail.com-20081014092444-eks872uko5dovwka
This commit is contained in:
Rucha Patel
2008-10-14 14:54:44 +05:30
parent 574bfc9db4
commit a00409ffc6
10 changed files with 652 additions and 96 deletions
+35
View File
@@ -0,0 +1,35 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import mrp_repair
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -52,7 +52,7 @@
"category":"Custom",
"depends":["sale","account"],
"demo_xml":[],
"update_xml":["repair_module_view.xml"],
"update_xml":["mrp_repair_view.xml", "mrp_repair_workflow.xml", "mrp_repair_report.xml"],
"active": False,
"installable": True,
}
@@ -31,6 +31,8 @@
import time
from osv import fields,osv
import netsvc
import mx.DateTime
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
class mrp_repair(osv.osv):
_name = 'mrp.repair'
@@ -49,8 +51,8 @@ class mrp_repair(osv.osv):
], 'State', readonly=True, help="Gives the state of the Repairs Order"),
'location_id': fields.many2one('stock.location', 'Current Location', required=True, select=True),
'location_dest_id': fields.many2one('stock.location', 'Delivery Location'),
'move_id': fields.many2one('stock.move', 'Move',required=True,domain="[('product_id','=',product_id)]"),#,('prodlot_id','=',prodlot_id)
'limit': fields.date('Guarantee limit', readonly=True),
'move_id': fields.many2one('stock.move', 'Move',required=True,domain="[('product_id','=',product_id),('location_dest_id','=',location_id)]"),#,('prodlot_id','=',prodlot_id)
'guarantee_limit': fields.date('Guarantee limit'),
'operations' : fields.one2many('repair.operation', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist'),
'partner_invoice_id':fields.many2one('res.partner.address', 'Invoice to', readonly=True, states={'draft':[('readonly',False)]}),
@@ -61,7 +63,7 @@ class mrp_repair(osv.osv):
], "Invoice Method",
select=True),
'invoice_id': fields.many2one('account.invoice', 'Invoice', readonly=True),
'fees_lines' : fields.one2many('sale.order.line', 'order_id', 'Fees Lines', readonly=True, states={'draft':[('readonly',False)]}),
# 'fees_lines' : fields.one2many('sale.order.line', 'order_id', 'Fees Lines', readonly=True, states={'draft':[('readonly',False)]}),
'internal_notes' : fields.text('Internal Notes'),
'quotation_notes' : fields.text('Quotation Notes'),
}
@@ -70,6 +72,37 @@ class mrp_repair(osv.osv):
'state': lambda *a: 'draft',
}
def onchange_product_id(self, cr, uid, ids, prod_id=False):
if not prod_id:
return {'value':{'prodlot_id': False , 'move_id': False, 'location_id' : False}}
product = self.pool.get('product.product').browse(cr, uid, [prod_id])[0]
current_date = time.strftime('%Y-%m-%d')
limit = mx.DateTime.strptime(current_date, '%Y-%m-%d') + RelativeDateTime(months=product.warranty, days=-1)
result = {
'guarantee_limit': limit.strftime('%Y-%m-%d'),
}
return { 'value' : result }
def onchange_partner_id(self, cr, uid, ids, part):
if not part:
return {'value':{'address_id': False , 'pricelist_id': False }}
addr = self.pool.get('res.partner').address_get(cr, uid, [part])
pricelist = self.pool.get('res.partner').property_get(cr, uid,
part,property_pref=['property_product_pricelist']).get('property_product_pricelist',False)
return {'value':{'address_id': addr['default'], 'pricelist_id': pricelist}}
def onchange_lot_id(self, cr, uid, ids, lot ):
if not lot:
return {'value':{'location_id': False , 'move_id' : False}}
lot_info = self.pool.get('stock.production.lot').browse(cr, uid, [lot])[0]
move_id = self.pool.get('stock.move').search(cr, uid,[('prodlot_id','=',lot)] )
if move_id:
move = self.pool.get('stock.move').browse(cr, uid, move_id )[0]
return {'value':{'location_id': move.location_dest_id.id , 'move_id': move.id }}
else:
return {'value':{'location_id': False , 'move_id' : False}}
mrp_repair()
@@ -78,16 +111,52 @@ class repair_operation(osv.osv):
_description = 'Repair Operation'
_columns = {
'repair_id': fields.many2one('mrp.repair', 'Repair Order Ref', required=True, ondelete='cascade', select=True),
'name': fields.selection([('add','Add'),('remove','Remove')],'Type', required=True),
'name': fields.selection([('add','Add'),('remove','Remove')],'Type'),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)]),
'invoice': fields.boolean('Invoice', readonly=True),
'price_unit': fields.float('Price', required=True),
'product_qty': fields.float('Quantity', digits=(16,2), required=True),
'product_uom': fields.many2one('product.uom', 'UoM', required=True),
'invoice': fields.boolean('Invoice'),
'price_unit': fields.float('Price'),
'product_qty': fields.float('Quantity', digits=(16,2)),
'product_uom': fields.many2one('product.uom', 'UoM'),
'location_id': fields.many2one('stock.location', 'Source Location', select=True),
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', select=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Nb.', select=True),
}
def product_id_change(self, cr, uid, ids, pricelist, product, uom=False, product_qty = 0,partner_id=False ):
if not product:
return {'value': {'product_qty' : 0.0, 'product_uom': False},'domain': {'product_uom': []}}
product_obj = self.pool.get('product.product').browse(cr, uid, product)
result = {}
if not uom:
result['product_uom'] = product_obj.uom_id.id
domain = {'product_uom':
[('category_id', '=', product_obj.uom_id.category_id.id)],}
if not pricelist:
warning={
'title':'No Pricelist !',
'message':
'You have to select a pricelist in the sale form !\n'
'Please set one before choosing a product.'
}
else:
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
product, product_qty or 1.0, partner_id, {
'uom': uom,
})[pricelist]
if price is False:
warning={
'title':'No valid pricelist line found !',
'message':
"Couldn't find a pricelist line matching this product and quantity.\n"
"You have to change either the product, the quantity or the pricelist."
}
else:
result.update({'price_unit': price})
return {'value': result , 'domain' :domain, 'warning':warning}
repair_operation()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="report_mrp_repair"
string="Repair Quotation"
model="mrp.repair"
name="repair.order"
rml="mrp_repair/report/order.rml"
auto="False"/>
</data>
</openerp>
+150
View File
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">mrp.repair.form</field>
<field name="model">mrp.repair</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Repairs order">
<group col="4" colspan="4">
<field name="product_id" select="1" on_change="onchange_product_id(product_id)"/>
<field name="prodlot_id" select="2" on_change="onchange_lot_id(prodlot_id)"/>
<field name="partner_id" select="2" on_change="onchange_partner_id(partner_id)" />
<field name="address_id"/>
</group>
<notebook colspan="4">
<page string="Products">
<field name="location_id"/>
<field name="move_id"/>
<field name="location_dest_id"/>
<field name="guarantee_limit"/>
<newline/>
<separator colspan="4" string="Operations"/>
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
<form string="Operations">
<field name="name"/>
<field name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_uom,product_qty, parent.partner_id)"/>
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="prodlot_id"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="invoice"/>
</form>
<tree string="Operations lines">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="prodlot_id"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="invoice"/>
</tree>
</field>
<newline/>
<group col="13" colspan="4">
<field name="state" select="2"/>
<button name="repair_confirm" states="draft" string="Confirm Repair"/>
<button name="repair_done" states="confirmed" string="Repair Done"/>
<button name="cancel" states="draft,confirmed,2binvoiced" string="Cancel Repair"/>
<button name="make_invoice" states="2binvoiced" string="Make Invoice"/>
</group>
</page>
<page string="Invoicing">
<field name="pricelist_id"/>
<field name="partner_invoice_id"/>
<field name="invoice_method"/>
<field name="invoice_id"/>
<separator colspan="4" string="Fees"/>
<!-- <field colspan="4" name="fees_lines" nolabel="1"/>-->
</page>
<page string="Quality">
<separator colspan="4" string="Internal Notes"/>
<field colspan="4" name="internal_notes" nolabel="1"/>
<separator colspan="4" string="Quotation Notes"/>
<field colspan="4" name="quotation_notes" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_repair_order_tree" model="ir.ui.view">
<field name="name">mrp.repair.tree</field>
<field name="model">mrp.repair</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Repairs order">
<field name="product_id" select="1" />
<field name="prodlot_id" select="2"/>
<field name="partner_id" select="2"/>
<field name="address_id"/>
<field name="location_id"/>
<field name="move_id"/>
<field name="location_dest_id"/>
<field name="guarantee_limit"/>
</tree>
</field>
</record>
<record id="action_repair_order_form" model="ir.actions.act_window">
<field name="name">New Repair</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
</record>
<record id="action_repair_order_tree" model="ir.actions.act_window">
<field name="name">Repair Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="action_repair_quotation_tree" model="ir.actions.act_window">
<field name="name">Repairs in quotation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
</record>
<record id="action_repair_progress_tree" model="ir.actions.act_window">
<field name="name">Repairs in progress</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','confirmed')]</field>
</record>
<record id="action_repair_2binvoiced_tree" model="ir.actions.act_window">
<field name="name">Repairs to be invoiced</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','2binvoiced')]</field>
</record>
<menuitem action="action_repair_order_tree" id="menu_repair_order" parent="mrp.menu_mrp_root" name="Repairs"/>
<menuitem action="action_repair_quotation_tree" id="menu_repair_quotation" parent="menu_repair_order"/>
<menuitem action="action_repair_progress_tree" id="menu_repair_progress" parent="menu_repair_order"/>
<menuitem action="action_repair_2binvoiced_tree" id="menu_repair_2binvoiced" parent="menu_repair_order"/>
<menuitem action="action_repair_order_form" id="menu_repair_form" parent="menu_repair_order" sequence = "50"/>
</data>
</openerp>
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="wkf_repair" model="workflow">
<field name="name">mrp.repair.basic</field>
<field name="osv">mrp.repair</field>
<field name="on_create">True</field>
</record>
<!-- Activity -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="flow_start">True</field>
<field name="name">draft</field>
<field name="split_mode">OR</field>
</record>
<record id="act_confirmed" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="name">confirmed</field>
<field name="kind">function</field>
<field name="action">write({'state':'confirmed'})</field>
</record>
<record id="act_2binvoiced" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="name">2binvoiced</field>
<field name="kind">function</field>
<field name="action">write({'state':'2binvoiced'})</field>
</record>
<record id="act_done" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="name">done</field>
<field name="kind">function</field>
<field name="action">write({'state':'done'})</field>
</record>
<record id="act_done" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="name">done</field>
<field name="kind">function</field>
<field name="action">write({'state':'done'})</field>
</record>
<record id="act_cancel" model="workflow.activity">
<field name="wkf_id" ref="wkf_repair"/>
<field name="name">cancel</field>
<field name="kind">function</field>
<field name="action">write({'state':'cancel'})</field>
</record>
<!-- Transistion -->
<record id="trans_draft_confirmed" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirmed"/>
<field name="signal">repair_confirm</field>
</record>
<record id="trans_draft_cancel" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">cancel</field>
</record>
<record id="trans_confirmed_done" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_done"/>
<field name="signal">repair_done</field>
</record>
<record id="trans_confirmed_cancel" model="workflow.transition">
<field name="act_from" ref="act_confirmed"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">cancel</field>
</record>
<record id="trans_2binvoiced_done" model="workflow.transition">
<field name="act_from" ref="act_2binvoiced"/>
<field name="act_to" ref="act_done"/>
<field name="signal">make_invoice</field>
</record>
<record id="trans_2binvoiced_cancel" model="workflow.transition">
<field name="act_from" ref="act_2binvoiced"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">cancel</field>
</record>
</data>
</openerp>
@@ -28,7 +28,7 @@
#
##############################################################################
import repair_module
import order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+44
View File
@@ -0,0 +1,44 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import time
from report import report_sxw
from osv import osv
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(order, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.repair.order','mrp.repair','addons/mrp_repair/report/order.rml',parser=order)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+236
View File
@@ -0,0 +1,236 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="42.0" width="527" height="758"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau2">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
<lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEAFTER" colorName="#000000" start="3,0" stop="3,-1"/>
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/>
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1"/>
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,-1"/>
<blockBackground colorName="#e6e6e6" start="3,0" stop="3,-1"/>
</blockTableStyle>
<blockTableStyle id="Tableau3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Tableau4">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="11"/>
<paraStyle name="P2" fontName="Times-Roman"/>
<paraStyle name="P3" fontName="Times-Roman" alignment="LEFT"/>
<paraStyle name="P4" fontName="Times-Roman" alignment="LEFT"/>
<paraStyle name="P5" fontName="Times-Bold" fontSize="9.0" leading="11"/>
<paraStyle name="P6" fontName="Times-Bold" fontSize="9.0" leading="11"/>
<paraStyle name="P7" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
<paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P9" fontName="Times-BoldItalic" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P10" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
<paraStyle name="P11" fontName="Times-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="P12" fontName="Times-Bold" fontSize="9.0" leading="11"/>
<paraStyle name="P13" fontName="Times-Roman" fontSize="10.0" leading="13"/>
<paraStyle name="P14" fontName="Times-Roman" fontSize="10.0" leading="13"/>
<paraStyle name="P15" fontName="Times-Roman" fontSize="4.0" leading="5"/>
<paraStyle name="P16" fontName="Times-Roman" fontSize="11.0" leading="14"/>
<paraStyle name="P17" fontName="Times-Roman" fontSize="16.0" leading="20"/>
<paraStyle name="P18" fontName="Times-BoldItalic" fontSize="6.0" leading="8" alignment="LEFT"/>
<paraStyle name="P19" fontName="Times-Roman" fontSize="7.0" leading="9"/>
<paraStyle name="P20" fontName="Times-BoldItalic" fontSize="11.0" leading="14"/>
<paraStyle name="P21" fontName="Times-BoldItalic" fontSize="11.0" leading="14" alignment="CENTER"/>
<paraStyle name="P22" fontName="Times-Roman" fontSize="11.0" leading="14"/>
<paraStyle name="P23" fontName="Times-Roman" fontSize="7.0" leading="9"/>
<paraStyle name="P24" fontName="Times-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
<paraStyle name="Standard" fontName="Times-Roman"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
</stylesheet>
<images/>
<story>
<para style="P1">[[ repeatIn(objects,'o') ]] <font face="Times-Roman">[[ setLang(o.partner_id.lang) ]]</font></para>
<blockTable colWidths="257.0,50.0,220.0" style="Tableau1">
<tr>
<td>
<para style="P5">Shipping address :</para>
<para style="P13">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
<para style="P13">[[ o.address_id.title or '' ]] [[ o.address_id.name ]]</para>
<para style="P13">[[ o.address_id.street ]]</para>
<para style="P13">[[ o.address_id.street2 or '' ]]</para>
<para style="P14"><font face="Times-Roman">[[ o.address_id.zip or '' ]]</font> [[ o.address_id.city or '' ]]</para>
<para style="P14">[[ o.address_id.state_id and o.address_id.state_id.name or '' ]]</para>
<para style="P14">[[ o.address_id.country_id and o.address_id.country_id.name or '' ]]</para>
<para style="P15">
<font color="white"> </font>
</para>
<para style="P6">Invoice address :</para>
<para style="P14">[[ o.address_id.street ]][[ o.address_id.street2 and (', %s' % o.address_id.street2 or '') ]]</para>
<para style="P14">[[ o.address_id.zip or '' ]] [[ o.address_id.city or '' ]] [[ o.address_id.country_id and (', %s' % (o.address_id.country_id and o.address_id.country_id.name or '')) ]]</para>
</td>
<td>
<para style="P16">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P13">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="P2">
<font color="white"> </font>
</para>
<para style="P17">[[ o.state&lt;&gt;'draft' and removeParentNode('para') ]] Quotation N° : [[ o.name ]]</para>
<para style="P17">[[ o.state=='draft' and removeParentNode('para') ]] Order N° : [[ o.name ]]</para>
<para style="P17">
<font color="white"> </font>
</para>
<para style="P22">Your order reference : [[ o.client_order_ref or '' ]]</para>
<para style="P22">Date ordered : [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]]</para>
<para style="P22">Our salesman : [[ o.user_id.name ]]</para>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="279.0,79.0,87.0,82.0" repeatRows="1" style="Tableau2">
<tr>
<td>
<para style="P20">Product</para>
</td>
<td>
<para style="P21">Quantity</para>
</td>
<td>
<para style="P21">Unit Price</para>
</td>
<td>
<para style="P21">Price</para>
</td>
</tr>
</blockTable>
<section>
<para style="P18">[[ repeatIn(o.operations,'line') ]]</para>
<blockTable colWidths="279.0,79.0,87.0,82.0" style="Tableau3">
<tr>
<td>
<para style="Table Contents">[[ line.product_id.name ]] </para>
</td>
<td>
<para style="Table Contents">[[ line.product_qty ]] [[ line.product_uom.name ]]</para>
</td>
<td>
<para style="Table Contents">[[ line.price_unit ]]</para>
</td>
<td>
<para style="Table Contents">[[ line.price_unit ]]</para>
</td>
</tr>
</blockTable>
</section>
<blockTable colWidths="348.0,69.0,110.0" style="Tableau6">
<tr>
<td>
<para style="P23">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P24">Net Total :</para>
</td>
<td>
<para style="P24">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P23">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P24">Taxes :</para>
</td>
<td>
<para style="P24">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P19">
<font color="white"> </font>
</para>
</td>
<td>
<para style="P11">TOTAL :</para>
</td>
<td>
<para style="P11">
<font color="white"> </font>
</para>
</td>
</tr>
</blockTable>
<para style="P12">
<font color="white"> </font>
</para>
<blockTable colWidths="527.0" style="Tableau4">
<tr>
<td>
<para style="P3">
<font color="white"> </font>
</para>
</td>
</tr>
<tr>
<td>
<para style="P3">[[ format((o.partner_id.property_payment_term and o.partner_id.property_payment_term[1]) or '') ]]</para>
</td>
</tr>
</blockTable>
<para style="P4">
<font color="white"> </font>
</para>
</story>
</document>
@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">mrp.repair.form</field>
<field name="model">mrp.repair</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales order">
<group col="4" colspan="4">
<field name="product_id" select="1" />
<field name="prodlot_id" select="2"/>
<field name="partner_id" select="2"/>
<field name="address_id"/>
</group>
<notebook colspan="4">
<page string="Products">
<field name="location_id"/>
<field name="move_id"/>
<field name="location_dest_id"/>
<field name="limit"/>
<newline/>
<separator colspan="4" string="Operations"/>
<field colspan="4" mode="tree,form" name="operations" nolabel="1" widget="one2many_list">
<form string="Operations">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="prodlot_id"/>
<field name="location_id"/>
<field name="invoice"/>
</form>
<tree string="Operations lines">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UoM"/>
<field name="price_unit"/>
<field name="prodlot_id"/>
<field name="location_id"/>
<field name="invoice"/>
</tree>
</field>
<newline/>
<group col="13" colspan="4">
<field name="state" select="2"/>
<!--<button name="repair_confirm" states="draft" string="Confirm Repair"/>
<button name="cancel" states="confirmed" string="Repair Done"/>
<button name="cancel" states="draft,confirmed,2binvoiced" string="Cancel Repair"/>
<button name="cancel" states="2binvoiced" string="Make Invoice"/> -->
</group>
</page>
<page string="Invoicing">
<field name="pricelist_id"/>
<field name="partner_invoice_id"/>
<field name="invoice_method"/>
<field name="invoice_id"/>
<separator colspan="4" string="Fees"/>
<field colspan="4" name="fees_lines" nolabel="1"/>
</page>
<page string="Quality">
<separator colspan="4" string="Internal Notes"/>
<field colspan="4" name="internal_notes" nolabel="1"/>
<separator colspan="4" string="Quotation Notes"/>
<field colspan="4" name="quotation_notes" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="action_repair_order_form" model="ir.actions.act_window">
<field name="name">Repair Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<menuitem action="action_repair_order_form" id="menu_repair_order" parent="mrp.menu_mrp_root"/>
</data>
</openerp>