[MERGE] forward port of branch 7.0 up to 33e0910

This commit is contained in:
Denis Ledoux 2014-09-09 18:02:30 +02:00
commit e447a46ec8
8 changed files with 18 additions and 17 deletions

View File

@ -285,7 +285,6 @@ class hr_expense_expense(osv.osv):
if not mres:
continue
res.append(mres)
tax_code_found= False
#Calculate tax according to default tax on product
taxes = []
@ -303,9 +302,9 @@ class hr_expense_expense(osv.osv):
a = product.categ_id.property_account_expense_categ.id
a = fpos_obj.map_account(cr, uid, fpos, a)
taxes = a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
if not taxes:
continue
tax_l = []
#Calculating tax on the line and creating move?
for tax in tax_obj.compute_all(cr, uid, taxes,
line.unit_amount ,
@ -313,15 +312,8 @@ class hr_expense_expense(osv.osv):
exp.user_id.partner_id)['taxes']:
tax_code_id = tax['base_code_id']
tax_amount = line.total_amount * tax['base_sign']
if tax_code_found:
if not tax_code_id:
continue
res.append(self.move_line_get_item(cr, uid, line, context))
res[-1]['price'] = 0.0
res[-1]['account_analytic_id'] = False
elif not tax_code_id:
if not tax_code_id:
continue
tax_code_found = True
res[-1]['tax_code_id'] = tax_code_id
res[-1]['tax_amount'] = cur_obj.compute(cr, uid, exp.currency_id.id, company_currency, tax_amount, context={'date': exp.date_confirm})
##
@ -339,7 +331,8 @@ class hr_expense_expense(osv.osv):
'tax_code_id': tax['tax_code_id'],
'tax_amount': tax['amount'] * tax['base_sign'],
}
res.append(assoc_tax)
tax_l.append(assoc_tax)
res += tax_l
return res
def move_line_get_item(self, cr, uid, line, context=None):

View File

@ -404,7 +404,7 @@ class mail_thread(osv.AbstractModel):
if not context.get('mail_notrack'):
# Perform the tracking
tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), context=context)
tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), context=track_ctx)
else:
tracked_fields = None
if tracked_fields:

View File

@ -1145,6 +1145,7 @@
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, False)"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
<button name="%(stock.move_scrap)d"
string="Scrap Products" type="action"
@ -1183,6 +1184,7 @@
<field name="product_id"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="product_uos" groups="product.group_uos"/>
<field name="location_id" groups="stock.group_locations" invisible="1"/>
<field name="picking_id" invisible="1" />

View File

@ -153,7 +153,7 @@ def ensure_db(redirect='/web/database/selector'):
return
# if db not provided, use the session one
if not db:
if not db and http.db_filter([request.session.db]):
db = request.session.db
# if no database provided and no database in session, use monodb
@ -682,6 +682,8 @@ class Home(http.Controller):
@http.route('/login', type='http', auth="none")
def login(self, db, login, key, redirect="/web", **kw):
if not http.db_filter([db]):
return werkzeug.utils.redirect('/', 303)
return login_and_redirect(db, login, key, redirect_url=redirect)
class WebClient(http.Controller):

View File

@ -2755,7 +2755,9 @@
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float.oe_readonly, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer.oe_readonly {
padding: 6px 0px 0px;
text-align: right;
max-width: 100px;
}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float span, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer span {
padding: 0px 6px;
}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
width: 100% !important;
@ -3175,7 +3177,6 @@
top: 0px;
}
}
.kitten-mode-activated {
background-size: cover;
background-attachment: fixed;

View File

@ -2213,7 +2213,8 @@ $sheet-padding: 16px
&.oe_readonly
padding: 6px 0px 0px
text-align: right
max-width: 100px
span
padding: 0px 6px
input
width: 100% !important
text-align: right

View File

@ -206,6 +206,8 @@ class ir_attachment(osv.osv):
for model, mids in res_ids.items():
# ignore attachments that are not attached to a resource anymore when checking access rights
# (resource was deleted but attachment was not)
if not self.pool.get(model):
continue
mids = self.pool[model].exists(cr, uid, mids)
ima.check(cr, uid, model, mode)
self.pool[model].check_access_rule(cr, uid, mids, mode, context=context)

View File

@ -597,7 +597,7 @@ command_re = re.compile("^Set-([a-z]+) *: *(.+)$", re.I + re.UNICODE)
# Updated in 7.0 to match the model name as well
# Typical form of references is <timestamp-openerp-record_id-model_name@domain>
# group(1) = the record ID ; group(2) = the model (if any) ; group(3) = the domain
reference_re = re.compile("<.*-open(?:object|erp)-(\\d+)(?:-([\w.]+))?.*@(.*)>", re.UNICODE)
reference_re = re.compile("<.*-open(?:object|erp)-(\\d+)(?:-([\w.]+))?[^>]*@([^>]*)>", re.UNICODE)
# Bounce regex
# Typical form of bounce is bounce-128-crm.lead-34@domain