<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">['|',('shop_id.company_id','=',False),('shop_id.company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">[('warehouse_id.company_id','child_of',[user.company_id.id])]</field>
</record>
+ <record id="rule_pos_order_report_multi_company" model="ir.rule">
+ <field name="name">Point Of Sale Order Analysis multi-company</field>
+ <field name="model_id" ref="model_report_pos_order"/>
+ <field name="global" eval="True"/>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ </record>
</data>
</openerp>
get_tax: function(){
return this.get_all_prices().tax;
},
+ get_tax_details: function(){
+ return this.get_all_prices().taxDetails;
+ },
get_all_prices: function(){
var self = this;
- var currency_rounding = this.pos.get('currency').rounding;
+ var currency_rounding = this.pos.currency.rounding;
- var base = round_pr(this.get_quantity() * this.get_unit_price() * (1.0 - (this.get_discount() / 100.0)), currency_rounding);
+ var base = round_pr(round_pr(this.get_quantity() * this.get_unit_price(), currency_rounding) * (1.0 - (this.get_discount() / 100.0)), currency_rounding);
var totalTax = base;
var totalNoTax = base;
# on a database with thousands of matching products, due to the huge merge+unique needed for the
# OR operator (and given the fact that the 'name' lookup results come from the ir.translation table
# Performing a quick memory merge of ids in Python will give much better performance
- ids = set()
- ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))
+ ids = set(self.search(cr, user, args + [('default_code', operator, name)], limit=limit, context=context))
if not limit or len(ids) < limit:
# we may underrun the limit because of dupes in the results, that's fine
- ids.update(self.search(cr, user, args + [('name',operator,name), ('id', 'not in', list(ids))], limit=(limit and (limit-len(ids)) or False) , context=context))
+ limit2 = (limit - len(ids)) if limit else False
- ids.update(self.search(cr, user, args + [('name', operator, name)], limit=limit2, context=context))
++ ids.update(self.search(cr, user, args + [('name', operator, name), ('id', 'not in', list(ids))], limit=limit2, context=context))
ids = list(ids)
elif not ids and operator in expression.NEGATIVE_TERM_OPERATORS:
ids = self.search(cr, user, args + ['&', ('default_code', operator, name), ('name', operator, name)], limit=limit, context=context)