summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-04-10 18:24:46 +0200
committerChristophe Simonis <chs@odoo.com>2015-04-10 18:24:46 +0200
commitd3e7a8ef5e825ff7b4c0f936345bb01961bd93d5 (patch)
tree7981890a0e66778f8d5375c9abb754e5c64eda16
parent59d82e6fe7ef9267c6380c271e51e6f5bc8aa383 (diff)
parent856bc6f2b147970245f96e26d882f114c32e035c (diff)
[MERGE] forward port of branch 7.0 up to 856bc6f
-rw-r--r--README6
-rw-r--r--addons/account/account_move_line.py16
-rw-r--r--addons/auth_crypt/auth_crypt.py3
-rw-r--r--addons/delivery/stock.py9
-rw-r--r--addons/mrp_operations/mrp_operations.py8
-rw-r--r--addons/sale/report/sale_report.py1
-rw-r--r--addons/sale_margin/sale_margin.py2
-rw-r--r--addons/sale_stock/report/sale_report.py1
-rw-r--r--addons/stock/stock.py1
-rw-r--r--openerp/addons/base/res/res_users.py9
-rw-r--r--openerp/osv/orm.py11
-rw-r--r--openerp/report/report_sxw.py1
12 files changed, 38 insertions, 30 deletions
diff --git a/README b/README
index 9449819d766..19afb8f46c3 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ Installation on Debian/Ubuntu
Add the the apt repository
- deb http://nightly.openerp.com/6.1/deb/ ./
+ deb http://nightly.odoo.com/7.0/nightly/deb/ ./
in your source.list and type:
@@ -44,8 +44,8 @@ Installation on Windows
Installation on MacOSX
-----------------------
-Setuping you first database
----------------------------
+Setting up your first database
+------------------------------
Point your browser to http://localhost:8069/ and click "Manage Databases", the
default master password is "admin".
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 374a48eace4..aea184c7d2c 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1243,15 +1243,23 @@ class account_move_line(osv.osv):
base_sign = 'base_sign'
tax_sign = 'tax_sign'
tmp_cnt = 0
- for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=True).get('taxes'):
+ for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=False).get('taxes'):
#create the base movement
if tmp_cnt == 0:
if tax[base_code]:
tmp_cnt += 1
- self.write(cr, uid,[result], {
+ if tax_id.price_include:
+ total = tax['price_unit']
+ newvals = {
'tax_code_id': tax[base_code],
- 'tax_amount': tax[base_sign] * abs(total)
- })
+ 'tax_amount': tax[base_sign] * abs(total),
+ }
+ if tax_id.price_include:
+ if tax['price_unit'] < 0:
+ newvals['credit'] = abs(tax['price_unit'])
+ else:
+ newvals['debit'] = tax['price_unit']
+ self.write(cr, uid, [result], newvals, context=context)
else:
data = {
'move_id': vals['move_id'],
diff --git a/addons/auth_crypt/auth_crypt.py b/addons/auth_crypt/auth_crypt.py
index c5bd5799017..a7e3a826223 100644
--- a/addons/auth_crypt/auth_crypt.py
+++ b/addons/auth_crypt/auth_crypt.py
@@ -22,6 +22,8 @@ _logger = logging.getLogger(__name__)
magic_md5 = '$1$'
magic_sha256 = '$5$'
+openerp.addons.base.res.res_users.USER_PRIVATE_FIELDS.append('password_crypt')
+
def gen_salt(length=8, symbols=None):
if symbols is None:
symbols = ascii_letters + digits
@@ -173,5 +175,4 @@ class res_users(osv.osv):
# Reraise password incorrect
raise
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py
index d8aeaf617eb..5ed07ee49a9 100644
--- a/addons/delivery/stock.py
+++ b/addons/delivery/stock.py
@@ -35,8 +35,9 @@ class stock_picking(osv.osv):
total_weight = total_weight_net = 0.00
for move in picking.move_lines:
- total_weight += move.weight
- total_weight_net += move.weight_net
+ if move.state != 'cancel':
+ total_weight += move.weight
+ total_weight_net += move.weight_net
res[picking.id] = {
'weight': total_weight,
@@ -57,12 +58,12 @@ class stock_picking(osv.osv):
'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
store={
'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
- 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
+ 'stock.move': (_get_picking_line, ['state','product_id','product_qty','product_uom','product_uos_qty'], 20),
}),
'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
store={
'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
- 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
+ 'stock.move': (_get_picking_line, ['state','product_id','product_qty','product_uom','product_uos_qty'], 20),
}),
'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
'number_of_packages': fields.integer('Number of Packages'),
diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py
index 52fdda1a7b2..06e5aa40030 100644
--- a/addons/mrp_operations/mrp_operations.py
+++ b/addons/mrp_operations/mrp_operations.py
@@ -220,7 +220,7 @@ class mrp_production(osv.osv):
result[prod.id] = max(line.date_planned_end, result[prod.id])
return result
- def action_production_end(self, cr, uid, ids):
+ def action_production_end(self, cr, uid, ids, context=None):
""" Finishes work order if production order is done.
@return: Super method
"""
@@ -230,9 +230,9 @@ class mrp_production(osv.osv):
if workcenter_line.state == 'draft':
workcenter_pool.signal_button_start_working(cr, uid, [workcenter_line.id])
workcenter_pool.signal_button_done(cr, uid, [workcenter_line.id])
- return super(mrp_production,self).action_production_end(cr, uid, ids)
+ return super(mrp_production,self).action_production_end(cr, uid, ids, context=context)
- def action_in_production(self, cr, uid, ids):
+ def action_in_production(self, cr, uid, ids, context=None):
""" Changes state to In Production and writes starting date.
@return: True
"""
@@ -240,7 +240,7 @@ class mrp_production(osv.osv):
for prod in self.browse(cr, uid, ids):
if prod.workcenter_lines:
workcenter_pool.signal_button_start_working(cr, uid, [prod.workcenter_lines[0].id])
- return super(mrp_production,self).action_in_production(cr, uid, ids)
+ return super(mrp_production,self).action_in_production(cr, uid, ids, context=context)
def action_cancel(self, cr, uid, ids, context=None):
""" Cancels work order if production order is canceled.
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 5d6a1cd759c..28d2459cc6a 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -44,6 +44,7 @@ class sale_report(osv.osv):
'nbr': fields.integer('# of Lines', readonly=True),
'state': fields.selection([
('draft', 'Quotation'),
+ ('sent', 'Quotation Sent'),
('waiting_date', 'Waiting Schedule'),
('manual', 'Manual In Progress'),
('progress', 'In Progress'),
diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py
index ec1bd83dd50..094a9b2ba6f 100644
--- a/addons/sale_margin/sale_margin.py
+++ b/addons/sale_margin/sale_margin.py
@@ -37,7 +37,7 @@ class sale_order_line(osv.osv):
to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id
if product:
product = self.pool['product.product'].browse(cr, uid, product, context=context)
- purchase_price = product.standard_price
+ purchase_price = product.price_get(ptype='standard_price', context=dict(context, currency_id=to_cur))[product.id]
to_uom = res.get('product_uom', uom)
if to_uom != product.uom_id.id:
purchase_price = self.pool['product.uom']._compute_price(cr, uid, product.uom_id.id, purchase_price, to_uom)
diff --git a/addons/sale_stock/report/sale_report.py b/addons/sale_stock/report/sale_report.py
index 7a8234fa7fa..77975afbd3a 100644
--- a/addons/sale_stock/report/sale_report.py
+++ b/addons/sale_stock/report/sale_report.py
@@ -30,6 +30,7 @@ class sale_report(osv.osv):
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',readonly=True),
'state': fields.selection([
('draft', 'Quotation'),
+ ('sent', 'Quotation Sent'),
('waiting_date', 'Waiting Schedule'),
('manual', 'Manual In Progress'),
('progress', 'In Progress'),
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 02b93eedaee..96f1e4de84c 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -725,6 +725,7 @@ class stock_picking(osv.osv):
default.setdefault('backorder_id', False)
if 'invoice_state' not in default and picking_obj.invoice_state == 'invoiced':
default['invoice_state'] = '2binvoiced'
+ default.setdefault('date_done', False)
res = super(stock_picking, self).copy(cr, uid, id, default, context)
return res
diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py
index f8c0290fd9b..088a8c6e821 100644
--- a/openerp/addons/base/res/res_users.py
+++ b/openerp/addons/base/res/res_users.py
@@ -38,6 +38,9 @@ _logger = logging.getLogger(__name__)
# Basic res.groups and res.users
#----------------------------------------------------------
+# Only users who can modify the user (incl. the user herself) see the real contents of these fields
+USER_PRIVATE_FIELDS = ['password']
+
class res_groups(osv.osv):
_name = "res.groups"
_description = "Access Groups"
@@ -278,8 +281,10 @@ class res_users(osv.osv):
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
def override_password(o):
- if 'password' in o and ('id' not in o or o['id'] != uid):
- o['password'] = '********'
+ if ('id' not in o or o['id'] != uid):
+ for f in USER_PRIVATE_FIELDS:
+ if f in o:
+ o[f] = '********'
return o
if fields and (ids == [uid] or ids == uid):
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 6ce96dd0838..786df44a5c9 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -1220,17 +1220,6 @@ class BaseModel(object):
for fpos2 in range(len(fields)):
if lines2 and lines2[0][fpos2]:
data[fpos2] = lines2[0][fpos2]
- if not data[fpos]:
- dt = ''
- for rr in r:
- name_relation = self.pool[rr._table_name]._rec_name
- if isinstance(rr[name_relation], browse_record):
- rr = rr[name_relation]
- rr_name = self.pool[rr._table_name].name_get(cr, uid, [rr.id], context=context)
- rr_name = rr_name and rr_name[0] and rr_name[0][1] or ''
- dt += tools.ustr(rr_name or '') + ','
- data[fpos] = dt[:-1]
- break
lines += lines2[1:]
first = False
else:
diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py
index e13f710c57f..d7329de7f39 100644
--- a/openerp/report/report_sxw.py
+++ b/openerp/report/report_sxw.py
@@ -236,6 +236,7 @@ class rml_parse(object):
self.localcontext['lang'] = lang
self.lang_dict_called = False
for obj in self.objects:
+ obj.refresh()
obj._context['lang'] = lang
def _get_lang_dict(self):