[FIX]mrp_repair:now commit with fixes

lp bug: https://launchpad.net/bugs/831583 fixed

bzr revid: mma@tinyerp.com-20110824055115-fq4dvruhm0kecbi1
This commit is contained in:
Mayur Maheshwari (OpenERP) 2011-08-24 11:21:15 +05:30
parent ae7b1699cb
commit ac32088ba1
4 changed files with 21 additions and 0 deletions

View File

@ -40,6 +40,7 @@ The aim is to have a complete module to manage all products repairs. The followi
'depends': ['mrp', 'sale', 'account'],
'update_xml': [
'security/ir.model.access.csv',
'security/mrp_repair_security.xml',
'mrp_repair_sequence.xml',
'wizard/mrp_repair_cancel_view.xml',
'wizard/mrp_repair_make_invoice_view.xml',

View File

@ -153,6 +153,7 @@ class mrp_repair(osv.osv):
'fees_lines': fields.one2many('mrp.repair.fee', 'repair_id', 'Fees Lines', readonly=True, states={'draft':[('readonly',False)]}),
'internal_notes': fields.text('Internal Notes'),
'quotation_notes': fields.text('Quotation Notes'),
'company_id': fields.many2one('res.company', 'Company'),
'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired. If cheked, it will create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."),
'invoiced': fields.boolean('Invoiced', readonly=True),
'repaired': fields.boolean('Repaired', readonly=True),
@ -178,6 +179,7 @@ class mrp_repair(osv.osv):
'deliver_bool': lambda *a: True,
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'mrp.repair'),
'invoice_method': lambda *a: 'none',
'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.repair', context=context),
'pricelist_id': lambda self, cr, uid,context : self.pool.get('product.pricelist').search(cr, uid, [('type','=','sale')])[0]
}

View File

@ -15,6 +15,7 @@
<field name="address_id"/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
<field name="guarantee_limit"/>
<field name="state"/>
</tree>
@ -159,6 +160,7 @@
<field name="picking_id"/>
<field name="location_id"/>
<field name="location_dest_id" attrs="{'readonly':[('deliver_bool','=', False)], 'required':[('deliver_bool','=', True)]}"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</page>
<page string="Notes">
<separator colspan="4" string="Internal Notes"/>
@ -199,6 +201,8 @@
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit"/>
<separator orientation="vertical" groups="base.group_multi_company"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Multi -->
<record model="ir.rule" id="mrp_repair_rule">
<field name="name">mrp_repair multi-company</field>
<field name="model_id" search="[('model','=','mrp.repair')]" model="ir.model"/>
<field name="global" eval="True"/>
<field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
</record>
</data>
</openerp>