From ac32088ba1c9ce9f28f412fd4b72cbc10cc4581a Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 24 Aug 2011 11:21:15 +0530 Subject: [PATCH] [FIX]mrp_repair:now commit with fixes lp bug: https://launchpad.net/bugs/831583 fixed bzr revid: mma@tinyerp.com-20110824055115-fq4dvruhm0kecbi1 --- addons/mrp_repair/__openerp__.py | 1 + addons/mrp_repair/mrp_repair.py | 2 ++ addons/mrp_repair/mrp_repair_view.xml | 4 ++++ addons/mrp_repair/security/mrp_repair_security.xml | 14 ++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 addons/mrp_repair/security/mrp_repair_security.xml diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py index 134b16542a5..6d55bf7d123 100644 --- a/addons/mrp_repair/__openerp__.py +++ b/addons/mrp_repair/__openerp__.py @@ -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', diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 3a538590d10..c88f34ad916 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -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] } diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index 16cdfc86b3d..2a818c73f71 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -15,6 +15,7 @@ + @@ -159,6 +160,7 @@ + @@ -199,6 +201,8 @@ + + diff --git a/addons/mrp_repair/security/mrp_repair_security.xml b/addons/mrp_repair/security/mrp_repair_security.xml new file mode 100644 index 00000000000..0b34310fc4e --- /dev/null +++ b/addons/mrp_repair/security/mrp_repair_security.xml @@ -0,0 +1,14 @@ + + + + + + + mrp_repair multi-company + + + ['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)] + + + + \ No newline at end of file