From c3c0f345a0a1e7c818bba12a03356096834a9543 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 16 Jan 2009 10:52:17 +0100 Subject: [PATCH 1/5] [FIX] if not specify, _log_access has now the same value as _auto (True by default) lp bug: https://launchpad.net/bugs/317699 fixed bzr revid: christophe@tinyerp.com-20090116095217-bxtmwt7gxlm0kb88 --- bin/osv/orm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 66860d31f73..6507d270370 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1354,7 +1354,6 @@ class orm_memory(orm_template): class orm(orm_template): _sql_constraints = [] - _log_access = True _table = None _protected = ['read','write','create','default_get','perm_read','unlink','fields_get','fields_view_get','search','name_get','distinct_field_get','name_search','copy','import_data','search_count'] @@ -1666,6 +1665,11 @@ class orm(orm_template): def __init__(self, cr): super(orm, self).__init__(cr) + + if not hasattr(self, '_log_access'): + # if not access is not specify, it is the same value as _auto + self._log_access = not hasattr(self, "_auto") or self._auto + self._columns = self._columns.copy() for store_field in self._columns: f = self._columns[store_field] From 07da35bd764dc9e8a2b66ac24df8864258a98b4b Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 16 Jan 2009 11:02:34 +0100 Subject: [PATCH 2/5] bugfixes bzr revid: fp@tinyerp.com-20090116100234-6mbe3ppdv4xfxq9d --- addons/account/invoice.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 2e5bb3c393f..abfbeb2353a 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -160,7 +160,12 @@ class account_invoice(osv.osv): def _get_invoice_from_line(self, cr, uid, ids, context={}): move = {} for line in self.pool.get('account.move.line').browse(cr, uid, ids): - move[line.move_id.id] = True + if line.reconcile_partial_id: + for line2 in line.reconcile_partial_id.line_partial_ids: + move[line2.move_id.id] = True + if line.reconcile_id: + for line2 in line.reconcile_id.line_id: + move[line2.move_id.id] = True invoice_ids = [] if move: invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context) From fde9552cd0fe7ef689d3ad6f3884e66bed243d82 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 16 Jan 2009 11:03:47 +0100 Subject: [PATCH 3/5] bugfix bzr revid: fp@tinyerp.com-20090116100347-jpqdg3xhvevgp7wv --- addons/point_of_sale/pos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 8b8c320152e..ce92ee977b2 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -343,8 +343,8 @@ class pos_order(osv.osv): 'product_uos': line.product_id.uom_id.id, 'picking_id': picking_id, 'product_id': line.product_id.id, - 'product_uos_qty': line.qty, - 'product_qty': line.qty, + 'product_uos_qty': abs(line.qty), + 'product_qty': abs(line.qty), 'tracking_id': False, 'state': 'waiting', 'location_id': location_id, From c4bd2a468bdb34e846917592e184edcc5f5e1775 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 16 Jan 2009 11:04:47 +0100 Subject: [PATCH 4/5] bugfix bzr revid: fp@tinyerp.com-20090116100447-3meg65sjfe45if12 --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 7ba71473913..d420bb828e1 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -34,7 +34,7 @@ class account_payment_term(osv.osv): _name = "account.payment.term" _description = "Payment Term" _columns = { - 'name': fields.char('Payment Term', size=32, translate=True, required=True), + 'name': fields.char('Payment Term', size=64, translate=True, required=True), 'active': fields.boolean('Active'), 'note': fields.text('Description', translate=True), 'line_ids': fields.one2many('account.payment.term.line', 'payment_id', 'Terms'), From dcde363845e205d1bcc3ecb46f5254b8c69ffece Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 16 Jan 2009 11:18:36 +0100 Subject: [PATCH 5/5] modifs bzr revid: fp@tinyerp.com-20090116101836-e4rz24l7e448xi97 --- addons/account/invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index abfbeb2353a..1e79931e059 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -56,6 +56,7 @@ class account_invoice(osv.osv): for line in invoice.tax_line: res[invoice.id]['amount_tax'] += line.amount res[invoice.id]['amount_total'] = res[invoice.id]['amount_tax'] + res[invoice.id]['amount_untaxed'] + print 'res', res return res def _get_journal(self, cr, uid, context): @@ -473,10 +474,12 @@ class account_invoice(osv.osv): def action_move_create(self, cr, uid, ids, *args): ait_obj = self.pool.get('account.invoice.tax') cur_obj = self.pool.get('res.currency') - self.button_compute(cr, uid, ids, context={}, set_total=False) for inv in self.browse(cr, uid, ids): + if not inv.tax_line: + self.button_compute(cr, uid, [inv], context={}, set_total=False) if inv.move_id: continue + print inv.check_total, inv.amount_total if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding/2.0): raise osv.except_osv(_('Bad total !'), _('Please verify the price of the invoice !\nThe real total does not match the computed total.')) if not inv.date_invoice: