[MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 9157 revid:dle@openerp.com-20140320181252-4gqcog22p1ex0pz7
bzr revid: chs@openerp.com-20140320134212-9nbuc7uqla4uiyf7 bzr revid: dle@openerp.com-20140320112958-slajf0ho0jtl7u60 bzr revid: dle@openerp.com-20140320161349-olyte7xt35nfj3dg bzr revid: dle@openerp.com-20140320181737-68q9xh9jhfjynjip
This commit is contained in:
commit
0e4cfe0add
|
@ -19,5 +19,11 @@
|
|||
<field name="global" eval="True" />
|
||||
<field name="domain_force">[('company_id', '=', user.company_id.id)]</field>
|
||||
</record>
|
||||
<record id="rule_pos_config_multi_company" model="ir.rule">
|
||||
<field name="name">Point Of Sale Config</field>
|
||||
<field name="model_id" ref="model_pos_config" />
|
||||
<field name="global" eval="True" />
|
||||
<field name="domain_force">[('warehouse_id.company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<separator string="Select your Point of Sale" colspan="4" attrs="{'invisible' : [('show_config', '=', False)]}" />
|
||||
<group attrs="{'invisible' : [('show_config', '=', False)]}">
|
||||
<field name="pos_config_id" on_change="on_change_config(pos_config_id)"
|
||||
widget="selection" domain="[('state','=','active')]"
|
||||
options="{'no_create': True}" domain="[('state','=','active')]"
|
||||
class="oe_inline"/>
|
||||
<field name="pos_state" invisible="1" />
|
||||
</group>
|
||||
|
|
|
@ -33,6 +33,10 @@ class stock_change_product_qty(osv.osv_memory):
|
|||
'prodlot_id': fields.many2one('stock.production.lot', 'Serial Number', domain="[('product_id','=',product_id)]"),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True, domain="[('usage', '=', 'internal')]"),
|
||||
}
|
||||
_defaults = {
|
||||
'new_quantity': 1,
|
||||
'product_id': lambda self, cr, uid, ctx: ctx and ctx.get('active_id', False) or False
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
if context is None: context = {}
|
||||
|
@ -54,20 +58,22 @@ class stock_change_product_qty(osv.osv_memory):
|
|||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
product_id = context and context.get('active_id', False) or False
|
||||
|
||||
res = super(stock_change_product_qty, self).default_get(cr, uid, fields, context=context)
|
||||
|
||||
if 'new_quantity' in fields:
|
||||
res.update({'new_quantity': 1})
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': product_id})
|
||||
if 'location_id' in fields:
|
||||
try:
|
||||
model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')
|
||||
self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context)
|
||||
except (orm.except_orm, ValueError):
|
||||
location_id = False
|
||||
res.update({'location_id': location_id})
|
||||
location_id = res.get('location_id', False)
|
||||
if not location_id:
|
||||
try:
|
||||
model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')
|
||||
except (orm.except_orm, ValueError):
|
||||
pass
|
||||
if location_id:
|
||||
try:
|
||||
self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context)
|
||||
except (orm.except_orm, ValueError):
|
||||
pass
|
||||
res['location_id'] = location_id
|
||||
return res
|
||||
|
||||
def change_product_qty(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'form_view_ref': False}</field>
|
||||
</record>
|
||||
|
||||
<record id="view_split_in_lots" model="ir.ui.view">
|
||||
|
@ -124,6 +125,7 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="context">{'form_view_ref': False}</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -37,7 +37,7 @@ e.g. To have an invoice generated automatically periodically:
|
|||
above. Specify the interval information and partner to be invoice.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'depends': [],
|
||||
'depends': ['base'],
|
||||
'data': ['security/subcription_security.xml', 'security/ir.model.access.csv', 'subscription_view.xml'],
|
||||
'demo': ['subscription_demo.xml',],
|
||||
'installable': True,
|
||||
|
|
|
@ -128,17 +128,8 @@ Thanks,''') % (name, self.pool.get('ir.config_parameter').get_param(cr, uid, 'we
|
|||
for use in exist_user:
|
||||
new_user.append(use.id)
|
||||
for id in survey_ref.browse(cr, uid, survey_ids):
|
||||
report = self.create_report(cr, uid, [id.id], 'report.survey.form', id.title)
|
||||
file = open(get_module_resource('survey', 'report') + id.title +".pdf")
|
||||
file_data = ""
|
||||
while 1:
|
||||
line = file.readline()
|
||||
file_data += line
|
||||
if not line:
|
||||
break
|
||||
file.close()
|
||||
attachments[id.title +".pdf"] = file_data
|
||||
os.remove(get_module_resource('survey', 'report') + id.title +".pdf")
|
||||
result, format = openerp.report.render_report(cr, uid, [id.id], 'survey.form', {}, {})
|
||||
attachments[id.title +".pdf"] = result
|
||||
|
||||
for partner in self.pool.get('res.partner').browse(cr, uid, partner_ids):
|
||||
if not partner.email:
|
||||
|
|
|
@ -1407,7 +1407,7 @@ instance.web.View = instance.web.Widget.extend({
|
|||
// Wrong group_by values will simply fail and forbid rendering of the destination view
|
||||
var ncontext = new instance.web.CompoundContext(
|
||||
_.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) {
|
||||
return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
|
||||
return pair[0].match('^(?:(?:default_|search_default_).+|.+_view_ref|group_by|group_by_no_leaf|active_id|active_ids)$') !== null;
|
||||
}))
|
||||
);
|
||||
ncontext.add(action_data.context || {});
|
||||
|
|
Loading…
Reference in New Issue