[PYTHON] +fix standard_price access to volunteers
authorLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 23 Jan 2018 17:10:40 +0000 (18:10 +0100)
committerLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 23 Jan 2018 17:10:40 +0000 (18:10 +0100)
lhc.py
security/ir.model.access.csv

diff --git a/lhc.py b/lhc.py
index 2ff4ee1..b172db2 100644 (file)
--- a/lhc.py
+++ b/lhc.py
@@ -25,6 +25,7 @@ from openerp.osv import osv
 from openerp.osv import orm
 from openerp.osv import fields
 
+import openerp.addons.decimal_precision as dp
 
 class res_partner(orm.Model):
     _inherit = 'res.partner'
@@ -33,4 +34,12 @@ class res_partner(orm.Model):
         'usual_contact': fields.boolean('Usual contact', help='This contact is a usual contact for L\'Heureux Cyclage employees. This field can be used to discriminated contacts for differents usages.'),
     }
 
+class product_template(orm.Model):
+    _inherit = 'product.template'
+
+    _columns = {
+        'standard_price': fields.float('Cost', digits_compute=dp.get_precision('Product Price'), help="Cost price of the product used for standard stock valuation in accounting and used as a base price on purchase orders.", groups="base.group_user,lhc.group_volunteer"),
+    }
+
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index c5dbd5e..0384c7f 100644 (file)
@@ -33,15 +33,14 @@ access_hr_employee_group_volunteer,hr_employee group_volunteer,hr.model_hr_emplo
 access_account_journal_group_volunteer,account_journal group_volunteer,account.model_account_journal,group_volunteer,1,0,0,0
 access_resource_group_volunteer,resource group_volunteer,resource.model_resource_resource,group_volunteer,1,0,0,0
 access_hr_department_group_volunteer,hr_department group_volunteer,hr.model_hr_department,group_volunteer,1,0,0,0
-access_product_uom_group_volunteer,product_uom group_volunteer,product.model_product_uom,group_volunteer,1,0,0,0
-access_product_template_group_volunteer,product_template group_volunteer,product.model_product_template,group_volunteer,1,0,0,0
-access_product_product_group_volunteer,product_product group_volunteer,product.model_product_product,group_volunteer,1,0,0,0
 access_product_price_type_group_volunteer,product_price_type group_volunteer,product.model_product_price_type,group_volunteer,1,0,0,0
+access_product_product_group_volunteer,product_product group_volunteer,product.model_product_product,group_volunteer,1,0,0,0
+access_product_supplierinfo_group_volunteer,product_supplierinfo group_volunteer,product.model_product_supplierinfo,group_volunteer,1,0,0,0
+access_product_template_group_volunteer,product_template group_volunteer,product.model_product_template,group_volunteer,1,0,0,0
+access_product_uom_group_volunteer,product_uom group_volunteer,product.model_product_uom,group_volunteer,1,0,0,0
 access_account_analytic_account_group_volunteer,account_analytic_account group_volunteer,project.model_account_analytic_account,group_volunteer,1,0,0,0
 access_mail_message_group_volunteer,mail_message group_volunteer,base_calendar.model_mail_message,group_volunteer,1,1,1,0
 access_mail_mail_group_volunteer,mail_mail group_volunteer,purchase.model_mail_mail,group_volunteer,1,1,1,0
 access_ir_attachment_group_volunteer,ir_attachment group_volunteer,base.model_ir_attachment,group_volunteer,1,1,1,1
 access_sheet_group_volunteer,timesheet_sheet group_volunteer,hr_timesheet_sheet.model_hr_timesheet_sheet_sheet,group_volunteer,1,0,0,0
-access_product_supplierinfo_group_volunteer,product_supplierinfo group_volunteer,product.model_product_supplierinfo,group_volunteer,1,0,0,0
 access_hr_holidays_status_group_volunteer,hr_holidays_status group_volunteer,hr_holidays.model_hr_holidays_status,group_volunteer,1,1,1,1
-