'process/service_product_process.xml',
'process/procurement_process.xml',
'report/mrp_report_view.xml',
- 'report/mrp_production_order_view.xml',
'board_manufacturing_view.xml',
'res_config_view.xml',
+
+ 'views/report_mrporder.xml',
+ 'views/report_mrpbomstructure.xml',
],
'demo': ['mrp_demo.xml'],
- #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company
- # so the ymls are too complex to change at this stage
'test': [
'test/bom_with_service_type_product.yml',
'test/mrp_users.yml',
class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
+
+ def _is_share(self, cr, uid, ids, name, args, context=None):
+ res = {}
+ for user in self.browse(cr, uid, ids, context=context):
+ res[user.id] = not self.has_group(cr, user.id, 'base.group_user')
+ return res
+
+ def _get_users_from_group(self, cr, uid, ids, context=None):
+ result = set()
+ for group in self.pool['res.groups'].browse(cr, uid, ids, context=context):
+ result.update(user.id for user in group.users)
+ return list(result)
+
_columns = {
- 'share': fields.boolean('Share User', readonly=True,
- help="External user with limited access, created only for the purpose of sharing data.")
+ 'share': fields.function(_is_share, string='Share User', type='boolean',
+ store={
+ 'res.users': (lambda self, cr, uid, ids, c={}: ids, None, 50),
+ 'res.groups': (_get_users_from_group, None, 50),
+ }, help="External user with limited access, created only for the purpose of sharing data."),
}
++
+ class res_groups(osv.osv):
+ _name = "res.groups"
+ _inherit = 'res.groups'
+ _columns = {
+ 'share': fields.boolean('Share Group', readonly=True,
+ help="Group created to set access rights for sharing data with some users.")
+ }
+
+ def init(self, cr):
+ # force re-generation of the user groups view without the shared groups
+ self.update_user_groups_view(cr, SUPERUSER_ID)
+ parent_class = super(res_groups, self)
+ if hasattr(parent_class, 'init'):
+ parent_class.init(cr)
+
+ def get_application_groups(self, cr, uid, domain=None, context=None):
+ if domain is None:
+ domain = []
+ domain.append(('share', '=', False))
+ return super(res_groups, self).get_application_groups(cr, uid, domain=domain, context=context)
+
+
++
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
cr, uid, context = request.cr, request.uid, request.context
order = self.get_order()
carrier_id = post.get('carrier_id')
-
- if order and carrier_id:
- # recompute delivery costs
- request.registry['website']._check_carrier_quotation(cr,uid,order,carrier_id,context=context)
- return request.redirect("/shop/payment")
+ if carrier_id:
+ carrier_id = int(carrier_id)
+ if order:
+ request.registry['sale.order']._check_carrier_quotation(cr, uid, order, force_carrier_id=carrier_id, context=context)
+ if carrier_id:
- return request.redirect("/shop/payment/")
++ return request.redirect("/shop/payment")
res = super(Ecommerce, self).payment(**post)
return res