diff --git a/addons/account/account.py b/addons/account/account.py index 6095c2aa113..5181028c17b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -231,9 +231,9 @@ class account_account(osv.osv): aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context) wheres = [""] - if query: + if query.strip(): wheres.append(query.strip()) - if aml_query: + if aml_query.strip(): wheres.append(aml_query.strip()) query = " AND ".join(wheres) @@ -251,6 +251,7 @@ class account_account(osv.osv): # consolidate accounts with direct children + ids2.reverse() brs = list(self.browse(cr, uid, ids2, context=context)) sums = {} while brs: @@ -270,8 +271,9 @@ class account_account(osv.osv): if current.child_id: sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id) res = {} + null_result = dict((fn, 0.0) for fn in field_names) for id in ids: - res[id] = sums[id] + res[id] = sums.get(id, null_result) return res def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}): @@ -313,7 +315,7 @@ class account_account(osv.osv): 'user_type': fields.many2one('account.account.type', 'Account Type', required=True, help="These types are defined according to your country. The type contains more information "\ "about the account and its specificities."), - 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), + 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids': fields.one2many('account.account','parent_id','Children'), 'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'), 'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"), @@ -450,18 +452,42 @@ class account_account(osv.osv): def _check_moves(self, cr, uid, ids, method, context): line_obj = self.pool.get('account.move.line') account_ids = self.search(cr, uid, [('id', 'child_of', ids)]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if method == 'write': raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.')) elif method == 'unlink': raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. ')) + #Checking whether the account is set as a property to any Partner or not + value = 'account.account,' + str(ids[0]) + partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context) + if partner_prop_acc: + raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.')) + return True + + def _check_allow_type_change(self, cr, uid, ids, new_type, context): + group1 = ['payable', 'receivable', 'other'] + group2 = ['consolidation','view'] + line_obj = self.pool.get('account.move.line') + for account in self.browse(cr, uid, ids, context=context): + old_type = account.type + account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): + #Check for 'Closed' type + if old_type == 'closed' and new_type !='closed': + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!")) + #Check for change From group1 to group2 and vice versa + if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1): + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,)) return True def write(self, cr, uid, ids, vals, context=None): - if not context: + if context is None: context = {} if 'active' in vals and not vals['active']: self._check_moves(cr, uid, ids, "write", context) + if 'type' in vals.keys(): + self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) def unlink(self, cr, uid, ids, context={}): @@ -557,15 +583,16 @@ class account_journal(osv.osv): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: - args=[] - if not context: - context={} + args = [] + if context is None: + context = {} ids = [] if name: - ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context) if not ids: - ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) + account_journal() class account_fiscalyear(osv.osv): @@ -631,6 +658,19 @@ class account_fiscalyear(osv.osv): else: return False return ids[0] + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) + account_fiscalyear() class account_period(osv.osv): @@ -706,12 +746,24 @@ class account_period(osv.osv): cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) cr.execute('update account_period set state=%s where id=%s', (mode, id)) return True + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) account_period() class account_journal_period(osv.osv): _name = "account.journal.period" - _description = "Journal - Period" + _description = "Journal Period" def _icon_get(self, cr, uid, ids, field_name, arg=None, context={}): result = {}.fromkeys(ids, 'STOCK_NEW') @@ -950,7 +1002,6 @@ class account_move(osv.osv): l[2]['period_id'] = default_period context['period_id'] = default_period - accnt_journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id']) if 'line_id' in vals: c = context.copy() c['novalidate'] = True @@ -1248,7 +1299,7 @@ class account_tax_code(osv.osv): _description = 'Tax Code' _rec_name = 'code' _columns = { - 'name': fields.char('Tax Case Name', size=64, required=True), + 'name': fields.char('Tax Case Name', size=64, required=True, translate=True), 'code': fields.char('Case Code', size=64), 'info': fields.text('Description'), 'sum': fields.function(_sum_year, method=True, string="Year Sum"), @@ -1262,6 +1313,15 @@ class account_tax_code(osv.osv): } + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if not args: + args = [] + if context is None: + context = {} + ids = self.search(cr, user, ['|',('name',operator,name),('code',operator,name)] + args, limit=limit, context=context) + return self.name_get(cr, user, ids, context) + + def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] @@ -1290,7 +1350,15 @@ class account_tax_code(osv.osv): return False level -= 1 return True + + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + default = default.copy() + default.update({'line_ids': []}) + return super(account_tax_code, self).copy(cr, uid, id, default, context) + _constraints = [ (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']) ] diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index ce6341cc9b2..1fa0a5c6cfa 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -30,7 +30,7 @@ from tools import config class account_analytic_line(osv.osv): _inherit = 'account.analytic.line' - _description = 'Analytic lines' + _description = 'Analytic Line' _columns = { 'product_uom_id' : fields.many2one('product.uom', 'UoM'), 'product_id' : fields.many2one('product.product', 'Product'), @@ -42,7 +42,7 @@ class account_analytic_line(osv.osv): } _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c), } _order = 'date' @@ -118,7 +118,7 @@ account_analytic_line() class timesheet_invoice(osv.osv): _name = "report.hr.timesheet.invoice.journal" - _description = "Analytic account costs and revenues" + _description = "Analytic Account Costs and Revenues" _auto = False _columns = { 'name': fields.char('Year',size=64,required=False, readonly=True), diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index deb010c7cd0..81b6e3157a1 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -387,7 +387,7 @@ account_bank_statement() class account_bank_statement_reconcile(osv.osv): _name = "account.bank.statement.reconcile" - _description = "Statement reconcile" + _description = "Statement Reconcile" def _total_entry(self, cursor, user, ids, name, attr, context=None): result = {} @@ -558,35 +558,40 @@ class account_bank_statement_line(osv.osv): def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): + res = {'value': {}} if not partner_id: - return {} - res_currency_obj = self.pool.get('res.currency') - res_users_obj = self.pool.get('res.users') - - company_currency_id = res_users_obj.browse(cursor, user, user, - context=context).company_id.currency_id.id - - if not currency_id: - currency_id = company_currency_id - - part = self.pool.get('res.partner').browse(cursor, user, partner_id, + return res + line = self.browse(cursor, user, line_id) + + if not line or (line and not line[0].account_id): + part = self.pool.get('res.partner').browse(cursor, user, partner_id, context=context) - if type == 'supplier': - account_id = part.property_account_payable.id - else: - account_id = part.property_account_receivable.id + if type == 'supplier': + account_id = part.property_account_payable.id + else: + account_id = part.property_account_receivable.id + res['value']['account_id'] = account_id - cursor.execute('SELECT sum(debit-credit) \ + if not line or (line and not line[0].amount): + res_users_obj = self.pool.get('res.users') + res_currency_obj = self.pool.get('res.currency') + company_currency_id = res_users_obj.browse(cursor, user, user, + context=context).company_id.currency_id.id + if not currency_id: + currency_id = company_currency_id + + cursor.execute('SELECT sum(debit-credit) \ FROM account_move_line \ WHERE (reconcile_id is null) \ AND partner_id = %s \ AND account_id=%s', (partner_id, account_id)) - res = cursor.fetchone() - balance = res and res[0] or 0.0 + pgres = cursor.fetchone() + balance = pgres and pgres[0] or 0.0 - balance = res_currency_obj.compute(cursor, user, company_currency_id, + balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) - return {'value': {'amount': balance, 'account_id': account_id}} + res['value']['amount'] = balance + return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): if not ids: @@ -625,7 +630,7 @@ class account_bank_statement_line(osv.osv): 'statement_id': fields.many2one('account.bank.statement', 'Statement', select=True, required=True, ondelete='cascade'), 'reconcile_id': fields.many2one('account.bank.statement.reconcile', - 'Reconcile', states={'confirm':[('readonly',True)]}), + 'Reconcile'), 'move_ids': fields.many2many('account.move', 'account_bank_statement_line_move_rel', 'move_id','statement_id', 'Moves'), @@ -633,7 +638,7 @@ class account_bank_statement_line(osv.osv): 'note': fields.text('Notes'), 'reconcile_amount': fields.function(_reconcile_amount, string='Amount reconciled', method=True, type='float'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement line."), + 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement lines."), } _defaults = { 'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'), diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 2ce4324f7c6..2da7c71021c 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -478,9 +478,11 @@ - - + + + + res.partner.invoice.info.inherit res.partner diff --git a/addons/account/account_invoice_workflow.xml b/addons/account/account_invoice_workflow.xml index 374a436e9ac..4c919765596 100644 --- a/addons/account/account_invoice_workflow.xml +++ b/addons/account/account_invoice_workflow.xml @@ -50,7 +50,7 @@ write({'state':'open'}) paid - write({'state':'paid'}) + confirm_paid() function subflow.paid diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a86fce20772..36b65d20dca 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -30,7 +30,7 @@ import tools class account_move_line(osv.osv): _name = "account.move.line" - _description = "Entry lines" + _description = "Entry Lines" def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') @@ -577,11 +577,12 @@ class account_move_line(osv.osv): merges_rec = [] for line in self.browse(cr, uid, ids, context): if line.reconcile_id: - raise osv.except_osv(_('Already Reconciled'), _('Already Reconciled')) + raise osv.except_osv(_('Warning'), _('Already Reconciled!')) if line.reconcile_partial_id: for line2 in line.reconcile_partial_id.line_partial_ids: if not line2.reconcile_id: - merges.append(line2.id) + if line2.id not in merges: + merges.append(line2.id) total += (line2.debit or 0.0) - (line2.credit or 0.0) merges_rec.append(line.reconcile_partial_id.id) else: @@ -774,6 +775,17 @@ class account_move_line(osv.osv): result['fields'] = self.fields_get(cr, uid, fields, context) return result + def _check_moves(self, cr, uid, context): + # use the first move ever created for this journal and period + cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) + res = cr.fetchone() + if res: + if res[1] != 'draft': + raise osv.except_osv(_('UserError'), + _('The account move (%s) for centralisation ' \ + 'has been confirmed!') % res[2]) + return res + def unlink(self, cr, uid, ids, context={}, check=True): self._update_check(cr, uid, ids, context) result = False @@ -809,7 +821,7 @@ class account_move_line(osv.osv): return True def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - if not context: + if context is None: context={} if vals.get('account_tax_id', False): raise osv.except_osv(_('Unable to change tax !'), _('You can not change the tax, you should remove and recreate lines !')) @@ -825,6 +837,24 @@ class account_move_line(osv.osv): if vals.get('date', False): todo_date = vals['date'] del vals['date'] + + for line in self.browse(cr, uid, ids,context=context): + ctx = context.copy() + if ('journal_id' not in ctx): + if line.move_id: + ctx['journal_id'] = line.move_id.journal_id.id + else: + ctx['journal_id'] = line.journal_id.id + if ('period_id' not in ctx): + if line.move_id: + ctx['period_id'] = line.move_id.period_id.id + else: + ctx['period_id'] = line.period_id.id + #Check for centralisation + journal = self.pool.get('account.journal').browse(cr, uid, ctx['journal_id'], context=ctx) + if journal.centralisation: + self._check_moves(cr, uid, context=ctx) + result = super(account_move_line, self).write(cr, uid, ids, vals, context) if check: @@ -891,14 +921,9 @@ class account_move_line(osv.osv): is_new_move = False if not move_id: if journal.centralisation: - # use the first move ever created for this journal and period - cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) - res = cr.fetchone() + #Check for centralisation + res = self._check_moves(cr, uid, context) if res: - if res[1] != 'draft': - raise osv.except_osv(_('UserError'), - _('The Ledger Posting (%s) for centralisation ' \ - 'has been confirmed!') % res[2]) vals['move_id'] = res[0] if not vals.get('move_id', False): @@ -926,7 +951,7 @@ class account_move_line(osv.osv): break if journal.account_control_ids and not ok: for a in journal.account_control_ids: - if a.id==vals['account_id']: + if a.id == vals['account_id']: ok = True break if (account.currency_id) and 'amount_currency' not in vals and account.currency_id.id <> company_currency: @@ -941,7 +966,7 @@ class account_move_line(osv.osv): if not ok: raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !')) - if 'analytic_account_id' in vals and vals['analytic_account_id']: + if vals.get('analytic_account_id',False): if journal.analytic_journal_id: vals['analytic_lines'] = [(0,0, { 'name': vals['name'], @@ -961,8 +986,8 @@ class account_move_line(osv.osv): result = super(osv.osv, self).create(cr, uid, vals, context) # CREATE Taxes - if 'account_tax_id' in vals and vals['account_tax_id']: - tax_id=tax_obj.browse(cr,uid,vals['account_tax_id']) + if vals.get('account_tax_id',False): + tax_id = tax_obj.browse(cr, uid, vals['account_tax_id']) total = vals['debit'] - vals['credit'] if journal.refund_journal: base_code = 'ref_base_code_id' @@ -978,7 +1003,7 @@ class account_move_line(osv.osv): tax_sign = 'tax_sign' tmp_cnt = 0 - for tax in tax_obj.compute(cr,uid,[tax_id],total,1.00): + for tax in tax_obj.compute(cr, uid, [tax_id], total, 1.00): #create the base movement if tmp_cnt == 0: if tax[base_code]: @@ -1031,7 +1056,7 @@ class account_move_line(osv.osv): # if context and ('__last_update' in context): # del context['__last_update'] # self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context) - if check and not context.get('no_store_function'): + if check and ((not context.get('no_store_function')) or journal.entry_posted): tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context) if journal.entry_posted and tmp: self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 5e514041d1d..6c5be231657 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -531,7 +531,10 @@ + + + @@ -551,6 +554,7 @@ + @@ -562,7 +566,7 @@
- + @@ -648,9 +652,9 @@ - + - + @@ -1453,9 +1457,11 @@ - + - + + + Account Add wizard diff --git a/addons/account/i18n/th.po b/addons/account/i18n/th.po index 320fdc82290..7389cdda788 100644 --- a/addons/account/i18n/th.po +++ b/addons/account/i18n/th.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-15 03:12+0000\n" +"PO-Revision-Date: 2010-05-20 07:09+0000\n" "Last-Translator: Songpon Phusing \n" "Language-Team: Thai \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n" +"X-Launchpad-Export-Date: 2010-05-21 03:38+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -51,7 +51,7 @@ msgstr "" #. module: account #: model:account.account.type,name:account.account_type_asset msgid "Asset" -msgstr "" +msgstr "สินทรัพย์" #. module: account #: constraint:ir.actions.act_window:0 @@ -106,7 +106,7 @@ msgstr "" #: model:ir.actions.wizard,name:account.wizard_vat_declaration #: model:ir.ui.menu,name:account.menu_wizard_vat_declaration msgid "Print Taxes Report" -msgstr "" +msgstr "พิมพ์รายงานภาษี" #. module: account #: field:account.account,parent_id:0 @@ -2133,7 +2133,8 @@ msgid "Analytic Entry" msgstr "" #. module: account -#: view:res.company:0 field:res.company,overdue_msg:0 +#: view:res.company:0 +#: field:res.company,overdue_msg:0 msgid "Overdue Payments Message" msgstr "" diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 34c7aa3e6ba..dbaa321f329 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -23,8 +23,8 @@ import time import decimal_precision as dp import netsvc + from osv import fields, osv, orm -import ir import pooler from tools import config from tools.translate import _ @@ -217,6 +217,7 @@ class account_invoice(osv.osv): _name = "account.invoice" _description = 'Invoice' _order = "number" + _log_create = True _columns = { 'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}), 'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."), @@ -333,7 +334,14 @@ class account_invoice(osv.osv): raise orm.except_orm(_('Configuration Error!'), _('There is no Accounting Journal of type Sale/Purchase defined!')) else: - raise + raise orm.except_orm(_('UnknownError'), str(e)) + + def confirm_paid(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'state':'paid'}, context=context) + for (id,name) in self.name_get(cr, uid, ids): + message = _('Document ') + " '" + name + "' "+ _("has been paid.") + self.log(cr, uid, id, message) + return True def unlink(self, cr, uid, ids, context=None): invoices = self.read(cr, uid, ids, ['state']) @@ -350,7 +358,7 @@ class account_invoice(osv.osv): # res = self.pool.get('res.partner').address_get(cr, uid, [part], ['invoice']) # return [{}] def onchange_partner_id(self, cr, uid, ids, type, partner_id, - date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): + date_invoice=False, payment_term=False, partner_bank=False, company_id=False): invoice_addr_id = False contact_addr_id = False partner_payment_term = False @@ -415,7 +423,7 @@ class account_invoice(osv.osv): else: result['value']['date_due'] = False - if partner_bank_id != bank_id: + if partner_bank != bank_id: to_update = self.onchange_partner_bank(cr, uid, ids, bank_id) result['value'].update(to_update['value']) return result @@ -450,7 +458,7 @@ class account_invoice(osv.osv): def onchange_invoice_line(self, cr, uid, ids, lines): return {} - def onchange_partner_bank(self, cursor, user, ids, partner_bank_id): + def onchange_partner_bank(self, cursor, user, ids, partner_bank): return {'value': {}} def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): @@ -650,6 +658,16 @@ class account_invoice(osv.osv): self.write(cr, uid, [inv.id], res['value']) return True + def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines): + """finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines + Hook method to be overridden in additional modules to verify and possibly alter the + move lines to be created by an invoice, for special cases. + :param invoice_browse: browsable record of the invoice that is generating the move lines + :param move_lines: list of dictionaries with the account.move.lines (as for create()) + :return: the (possibly updated) final move_lines to create for this invoice + """ + return move_lines + def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj): if not inv.tax_line: for tax in compute_taxes.values(): @@ -912,7 +930,12 @@ class account_invoice(osv.osv): # will be automatically deleted too account_move_obj.unlink(cr, uid, [i['move_id'][0]]) if i['payment_ids']: - self.pool.get('account.move.line').write(cr, uid, i['payment_ids'], {'reconcile_partial_id': False}) + account_move_line_obj = self.pool.get('account.move.line') + pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids']) + for move_line in pay_ids: + if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids: + raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!')) + self.write(cr, uid, ids, {'state':'cancel', 'move_id':False}) self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice') return True @@ -1147,14 +1170,14 @@ class account_invoice_line(osv.osv): t = t - (p * l[2].get('quantity')) taxes = l[2].get('invoice_line_tax_id') if len(taxes[0]) >= 3 and taxes[0][2]: - taxes=tax_obj.browse(cr, uid, taxes[0][2]) + taxes = tax_obj.browse(cr, uid, taxes[0][2]) for tax in tax_obj.compute(cr, uid, taxes, p,l[2].get('quantity'), context.get('address_invoice_id', False), l[2].get('product_id', False), context.get('partner_id', False)): t = t - tax['amount'] return t return 0 _name = "account.invoice.line" - _description = "Invoice line" + _description = "Invoice Line" _columns = { 'name': fields.char('Description', size=256, required=True), 'origin': fields.char('Origin', size=256, help="Reference of the document that produced this invoice."), @@ -1200,8 +1223,8 @@ class account_invoice_line(osv.osv): part = self.pool.get('res.partner').browse(cr, uid, partner_id) fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False - lang=part.lang - context.update({'lang': lang}) + if part.lang: + context.update({'lang': part.lang}) result = {} res = self.pool.get('product.product').browse(cr, uid, product, context=context) diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 494c0f71a48..edbe704d4db 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -113,6 +113,7 @@ + diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 71e57cb82e2..e57629d2618 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -25,13 +25,13 @@ - + @@ -97,6 +97,7 @@ form tree,graph,form + {"search_default_user_id":uid} @@ -188,11 +189,11 @@ - + @@ -202,6 +203,7 @@ ir.actions.act_window account.analytic.line form + {"search_default_user_id":uid} diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py index 54fbaddc4d9..458827d8bf3 100644 --- a/addons/account/project/report/analytic_check.py +++ b/addons/account/project/report/analytic_check.py @@ -54,12 +54,12 @@ class account_analytic_analytic_check(report_sxw.rml_parse): self.cr.execute("SELECT abs(sum(amount)) AS balance \ FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) + WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) (ad,) = self.cr.fetchone() ad = ad or 0.0 self.cr.execute("SELECT abs(sum(amount)) AS balance \ FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) + WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) (ac,) = self.cr.fetchone() ac = ac or 0.0 diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 461347cbfbb..160a77f6ffa 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -85,10 +85,6 @@ - account.invoice.report form tree,graph - {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} + {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[],'search_default_user_id':uid} diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index 2713b665d06..e8e1a7dc84c 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -84,8 +84,8 @@ + - [[ repeatIn(objects,'o') ]] [[ setLang(o.lang) ]] @@ -177,16 +177,16 @@ [[ line['ref'] ]] - [[ line['date_maturity'] ]] + [[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]] - [[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] - [[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] - [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]] + [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d'))) and (line['debit'] - line['credit']) ]] [[ line['blocked'] and 'X' or '' ]] @@ -205,13 +205,13 @@ Sub-Total : - [[ formatLang((reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] @@ -229,7 +229,7 @@ Balance : - [[ formatLang((reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] @@ -248,9 +248,9 @@ - Total amount due: [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] [[ company.currency_id.name ]]. + Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]]. - + \ No newline at end of file diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index e1aa3b6510a..7458594d240 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -15,8 +15,8 @@ "access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1 "access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1 "access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1 -"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0 -"access_account_tax","account.tax","model_account_tax",,1,0,0,0 +"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_invoice",1,0,0,0 +"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0 "access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1 "access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1 "access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1 @@ -93,3 +93,13 @@ "access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0 "access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0 "access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0 +"access_project_account_analytic_line","project.account.analytic.line","model_project_account_analytic_line","account.group_account_manager",1,1,1,1 +"access_account_move_line_reconcile_select","account.move.line.reconcile.select","model_account_move_line_reconcile_select","account.group_account_manager",1,1,1,1 +"access_account_move_line_unreconcile_select","account.move.line.unreconcile.select","model_account_move_line_unreconcile_select","account.group_account_manager",1,1,1,1 +"access_account_invoice_refund","account.invoice.refund","model_account_invoice_refund","account.group_account_manager",1,1,1,1 +"access_account_move_journal","account.move.journal","model_account_move_journal","account.group_account_manager",1,1,1,1 +"access_account_move_bank_reconcile","account.move.bank.reconcile","model_account_move_bank_reconcile","account.group_account_manager",1,1,1,1 +"access_account_subscription_generate","account.subscription.generate","model_account_subscription_generate","account.group_account_manager",1,1,1,1 +"access_account_period_close","account.period.close","model_account_period_close","account.group_account_manager",1,1,1,1 +"access_account_fiscalyear_close_state","account.fiscalyear.close.state","model_account_fiscalyear_close_state","account.group_account_manager",1,1,1,1 +"access_account_chart","account.chart","model_account_chart","account.group_account_manager",1,1,1,1 diff --git a/addons/account/sequence.py b/addons/account/sequence.py index d48f23eb1cf..e23ec1e3def 100644 --- a/addons/account/sequence.py +++ b/addons/account/sequence.py @@ -42,7 +42,7 @@ class ir_sequence(osv.osv): _columns = { 'fiscal_ids' : fields.one2many('account.sequence.fiscalyear', 'sequence_main_id', 'Sequences') } - def get_id(self, cr, uid, sequence_id, test='id', context={}): + def get_id(self, cr, uid, sequence_id, test='id', context={}): cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,)) res = cr.dictfetchone() if res: diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index f7e9d79b27a..506155e1ff1 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ import netsvc +import time class account_invoice_refund(osv.osv_memory): @@ -29,10 +30,14 @@ class account_invoice_refund(osv.osv_memory): _name = "account.invoice.refund" _description = "Invoice Refund" _columns = { - 'date': fields.date('Operation date', required=False), + 'date': fields.date('Operation date', required=False, help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'), 'period': fields.many2one('account.period', 'Force period', required=False), 'description': fields.char('Description', size=150, required=True), - } + } + + _defaults = { + 'date': time.strftime('%Y-%m-%d'), + } def compute_refund(self, cr, uid, ids, mode, context=None): """ @@ -167,7 +172,7 @@ class account_invoice_refund(osv.osv_memory): xml_id = 'action_invoice_tree1' elif inv.type == 'in_invoice': xml_id = 'action_invoice_tree2' - elif type == 'out_refund': + elif inv.type == 'out_refund': xml_id = 'action_invoice_tree3' else: xml_id = 'action_invoice_tree4' diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index 1f745419c5a..be0ebc40677 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -19,7 +19,6 @@ # ############################################################################## import time -import datetime from osv import fields, osv from tools.translate import _ diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py index d50994a6f28..c1de3294c79 100644 --- a/addons/account/wizard/account_unreconcile.py +++ b/addons/account/wizard/account_unreconcile.py @@ -29,11 +29,17 @@ class account_unreconcile(osv.osv_memory): obj_move_reconcile = self.pool.get('account.move.reconcile') if context is None: context = {} - recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id',]) - recs = filter(lambda x: x['reconcile_id'], recs) - rec_ids = [rec['reconcile_id'][0] for rec in recs] - if len(rec_ids): - obj_move_reconcile.unlink(cr, uid, rec_ids) + recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) + unlink_ids = [] + full_recs = filter(lambda x: x['reconcile_id'], recs) + rec_ids = [rec['reconcile_id'][0] for rec in full_recs] + part_recs = filter(lambda x: x['reconcile_partial_id'], recs) + part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs] + unlink_ids += rec_ids + unlink_ids += part_rec_ids + + if len(unlink_ids): + pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, unlink_ids) return {} account_unreconcile() @@ -44,10 +50,11 @@ class account_unreconcile_reconcile(osv.osv_memory): def trans_unrec_reconcile(self, cr, uid, ids, context=None): obj_move_reconcile = self.pool.get('account.move.reconcile') + rec_ids = context['active_ids'] if context is None: context = {} if len(rec_ids): - obj_move_reconcile.unlink(cr, uid, context['active_ids']) + obj_move_reconcile.unlink(cr, uid, rec_ids) return {} account_unreconcile_reconcile() diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 7e4807a3f81..742ef74cc84 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -393,7 +393,7 @@ account_analytic_account() class account_analytic_account_summary_user(osv.osv): _name = "account_analytic_analysis.summary.user" - _description = "Hours summary by user" + _description = "Hours Summary by User" _order='user' _auto = False _rec_name = 'user' diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index ab81e7d88fc..84fd933d9a9 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -25,7 +25,7 @@ import time class account_analytic_default(osv.osv): _name = 'account.analytic.default' - _description = 'Analytic Distributions' + _description = 'Analytic Distribution' _rec_name = 'analytic_id' _order = 'sequence' _columns = { @@ -69,7 +69,7 @@ account_analytic_default() class account_invoice_line(osv.osv): _inherit = 'account.invoice.line' - _description = 'account invoice line' + _description = 'Invoice Line' def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context) @@ -103,6 +103,8 @@ class sale_order_line(osv.osv): # Method overridden to set the analytic account by default on criterion match def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) + if not ids: + return create_ids sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 57acdb6dee5..db441d0931f 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -54,7 +54,7 @@ class one2many_mod2(fields.one2many): class account_analytic_plan(osv.osv): _name = "account.analytic.plan" - _description = "Analytic Plans" + _description = "Analytic Plan" _columns = { 'name': fields.char('Analytic Plan', size=64, required=True, select=True,), 'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'), @@ -63,7 +63,7 @@ account_analytic_plan() class account_analytic_plan_line(osv.osv): _name = "account.analytic.plan.line" - _description = "Analytic Plan Lines" + _description = "Analytic Plan Line" _columns = { 'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'), 'name': fields.char('Plan Name', size=64, required=True, select=True), @@ -297,14 +297,15 @@ class account_move_line(osv.osv): def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) + analytic_line_obj = self.pool.get('account.analytic.line') for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,)) - toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context) + toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context) if toremove: - line.unlink(cr, uid, toremove, context=context) + analytic_line_obj.unlink(cr, uid, toremove, context=context) for line2 in line.analytics_id.account_ids: val = (line.credit or 0.0) - (line.debit or 0.0) amt=val * (line2.rate/100) @@ -321,7 +322,7 @@ class account_move_line(osv.osv): 'journal_id': line.journal_id.analytic_journal_id.id, 'ref': line.ref, } - ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals) + ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context) return True account_move_line() diff --git a/addons/account_anglo_saxon/purchase.py b/addons/account_anglo_saxon/purchase.py index 98694a3d5dd..ac2dffbfd22 100644 --- a/addons/account_anglo_saxon/purchase.py +++ b/addons/account_anglo_saxon/purchase.py @@ -24,7 +24,7 @@ from osv import fields, osv class purchase_order(osv.osv): _name = "purchase.order" _inherit = "purchase.order" - _description = "Purchase order" + _description = "Purchase Order" def inv_line_create(self, cr, uid, a, ol): line = super(purchase_order, self).inv_line_create(cr, uid, a, ol) @@ -37,5 +37,4 @@ class purchase_order(osv.osv): a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa) line[2].update({'account_id': a}) return line -purchase_order() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +purchase_order() diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index 0fdb10c89a6..0e2ef2a363d 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -239,7 +239,7 @@ class crossovered_budget_lines(osv.osv): res[line.id]=0.00 return res _name="crossovered.budget.lines" - _description = "Budget Lines" + _description = "Budget Line" _columns = { 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True), diff --git a/addons/account_chart/i18n/th.po b/addons/account_chart/i18n/th.po new file mode 100644 index 00000000000..e53bfc9b6c2 --- /dev/null +++ b/addons/account_chart/i18n/th.po @@ -0,0 +1,23 @@ +# Thai translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-20 04:33+0000\n" +"Last-Translator: Songpon Phusing \n" +"Language-Team: Thai \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-21 03:38+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_chart +#: model:ir.module.module,description:account_chart.module_meta_information +msgid "Remove minimal account chart" +msgstr "ทำการลบตัวอย่างผังบัญชีแบบง่าย" diff --git a/addons/account_followup/followup.py b/addons/account_followup/followup.py index 5eaa2a4e25a..c8bf9537f13 100644 --- a/addons/account_followup/followup.py +++ b/addons/account_followup/followup.py @@ -23,7 +23,7 @@ from osv import fields, osv class followup(osv.osv): _name = 'account_followup.followup' - _description = 'Follow-Ups' + _description = 'Follow-Up' _columns = { 'name': fields.char('Name', size=64, required=True), 'description': fields.text('Description'), @@ -34,7 +34,7 @@ followup() class followup_line(osv.osv): _name = 'account_followup.followup.line' - _description = 'Follow-Ups Criteria' + _description = 'Follow-Up Criteria' _columns = { 'name': fields.char('Name', size=64, required=True), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of follow-up lines."), diff --git a/addons/account_followup/followup_report.py b/addons/account_followup/followup_report.py index 79cd6006e2b..5ce062ebd0b 100644 --- a/addons/account_followup/followup_report.py +++ b/addons/account_followup/followup_report.py @@ -30,7 +30,7 @@ def _code_get(self, cr, uid, context={}): class account_followup_stat(osv.osv): _name = "account_followup.stat" - _description = "Followup statistics" + _description = "Followup Statistics" _auto = False _columns = { 'name': fields.many2one('res.partner', 'Partner', readonly=True), diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml index 4b5e77beb87..ae31f7253a2 100644 --- a/addons/account_followup/followup_view.xml +++ b/addons/account_followup/followup_view.xml @@ -124,7 +124,7 @@ - + diff --git a/addons/account_payment/payment.py b/addons/account_payment/payment.py index 8f68bdaf46f..8e300f7072a 100644 --- a/addons/account_payment/payment.py +++ b/addons/account_payment/payment.py @@ -28,7 +28,7 @@ import pooler class payment_type(osv.osv): _name= 'payment.type' - _description= 'Payment type' + _description= 'Payment Type' _columns= { 'name': fields.char('Name', size=64, required=True,help='Payment Type'), 'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'), @@ -43,7 +43,7 @@ payment_type() class payment_mode(osv.osv): _name= 'payment.mode' - _description= 'Payment mode' + _description= 'Payment Mode' _columns= { 'name': fields.char('Name', size=64, required=True,help='Mode of Payment'), 'bank_id': fields.many2one('res.partner.bank', "Bank account", diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index 63dd950520f..d238fe952fc 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -25,6 +25,8 @@ + + @@ -279,7 +281,6 @@ - diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py index 001804c9e8a..266dcb535d8 100644 --- a/addons/account_payment/wizard/account_payment_order.py +++ b/addons/account_payment/wizard/account_payment_order.py @@ -104,7 +104,7 @@ class payment_order_create(osv.osv_memory): # Search for move line to pay: domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)] - domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)] + domain = domain + ['|',('date_maturity','<=',search_due_date),('date_maturity','=',False)] line_ids = line_obj.search(cr, uid, domain, context=context) context.update({'line_ids': line_ids}) model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context) diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py index 3f8f9330343..381f0d0f8f7 100644 --- a/addons/account_payment/wizard/account_payment_populate_statement.py +++ b/addons/account_payment/wizard/account_payment_populate_statement.py @@ -106,5 +106,3 @@ class account_payment_populate_statement(osv.osv_memory): return {'type' : 'ir.actions.act_window_close'} account_payment_populate_statement() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 7a6d65878f0..a3f92676111 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -32,7 +32,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime class account_report(osv.osv): _name = "account.report.report" - _description = "Account reporting" + _description = "Account Reporting" # _color = [ # ('', ''), # ('green','Green'), diff --git a/addons/account_reporting/account.py b/addons/account_reporting/account.py index ad1ce59f769..0b4a16b0dd8 100644 --- a/addons/account_reporting/account.py +++ b/addons/account_reporting/account.py @@ -30,7 +30,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime class color_rml(osv.osv): _name = "color.rml" - _description = "Rml Colors" + _description = "Rml Color" _columns = { 'name': fields.char('Name', size=64, required=True), 'code': fields.char('code',size=64,required=True), diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 66b701fb97a..140442aa02e 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -103,7 +103,7 @@ class account_voucher(osv.osv): ],'Type', readonly=True, select=True , size=128), 'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}), 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]), 'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=True), @@ -167,15 +167,14 @@ class account_voucher(osv.osv): return {'value':{'account_id':account_id.id}} def open_voucher(self, cr, uid, ids, context={}): - obj=self.pool.get('account.voucher').browse(cr,uid,ids) - total=0 + obj = self.pool.get('account.voucher').browse(cr,uid,ids) + total = 0 for i in obj[0].payment_ids: - total+=i.amount - if total!=0: - self.write(cr,uid,ids,{'amount':total}) - self.write(cr, uid, ids, {'state':'proforma'}) + total += i.amount + if total != 0: + self.write(cr, uid, ids, {'amount':total, 'state':'proforma'}) else: - raise osv.except_osv('Invalid action !', 'You can not post to Pro-Forma a voucher with Total amount = 0') + raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !') return True def proforma_voucher(self, cr, uid, ids, context={}): @@ -302,9 +301,9 @@ class account_voucher(osv.osv): name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) move = { - 'name': name, + 'name' : name, 'journal_id': journal_id, - 'voucher_type':inv.type, + 'type' : inv.type, 'narration' : inv.narration } if inv.period_id: @@ -487,7 +486,7 @@ class account_voucher_line(osv.osv): _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher'), 'name':fields.char('Description', size=256, required=True), - 'account_id':fields.many2one('account.account','Account', required=True), + 'account_id':fields.many2one('account.account','Account', required=True, domain=[('type','<>','view')]), 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True), 'amount':fields.float('Amount'), 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Type'), diff --git a/addons/analytic/project.py b/addons/analytic/project.py index c0f01322a6c..a3425c3925b 100644 --- a/addons/analytic/project.py +++ b/addons/analytic/project.py @@ -31,7 +31,7 @@ import decimal_precision as dp class account_analytic_account(osv.osv): _name = 'account.analytic.account' - _description = 'Analytic Accounts' + _description = 'Analytic Account' def _compute_currency_for_level_tree(self, cr, uid, ids, ids2, res, acc_set, context={}): # Handle multi-currency on each level of analytic account @@ -285,7 +285,7 @@ account_analytic_account() class account_analytic_line(osv.osv): _name = 'account.analytic.line' - _description = 'Analytic lines' + _description = 'Analytic Line' def _amount_currency(self, cr, uid, ids, field_name, arg, context={}): result = {} for rec in self.browse(cr, uid, ids, context): @@ -343,7 +343,7 @@ class account_analytic_line(osv.osv): } _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c), } _order = 'date' account_analytic_line() diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index c5c2af729a0..fe238d373be 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -100,7 +100,7 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit=self.on_change_unit_amount(cr, uid, ids, + amount_unit = self.on_change_unit_amount(cr, uid, ids, r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount'] amount = unit_amount * amount_unit @@ -136,7 +136,7 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit=self.on_change_unit_amount(cr, uid, ids, + amount_unit = self.on_change_unit_amount(cr, uid, ids, r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount'] amount = unit_amount * amount_unit diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py index 8918a6394aa..cd27c60fdb7 100644 --- a/addons/auction/__openerp__.py +++ b/addons/auction/__openerp__.py @@ -50,8 +50,10 @@ 'wizard/auction_payer_sel_view.xml', 'wizard/auction_lots_sms_send_view.xml', 'wizard/auction_catalog_flagey_view.xml', +# 'wizard/auction_aie_send_view.xml', # 'wizard/auction_aie_send_result_view.xml', 'wizard/auction_lots_buyer_map_view.xml', +# 'wizard/auction_lots_numerotate_view.xml', 'auction_view.xml', 'auction_report.xml', diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv index 1c1df0828ca..cc3a2e304f7 100644 --- a/addons/auction/security/ir.model.access.csv +++ b/addons/auction/security/ir.model.access.csv @@ -32,3 +32,5 @@ "acess_auction_payer","auction.payer","model_auction_payer","base.group_user",1,0,0,0 "access_auction_pay_sel","auction.pay.sel","model_auction_payer_sel","base.group_user",1,0,0,0 "acess_auction_taken","auction.taken","model_auction_taken","base.group_user",1,0,0,0 +"access_auction_catalog_flagey","auction.catalog.flagey","model_auction_catalog_flagey","base.group_user",1,0,0,0 +"access_auction_lots_buyer_map_user","auction_lots_buyer_map_user","model_auction_lots_buyer_map","base.group_user",1,0,0,0 diff --git a/addons/auction/wizard/__init__.py b/addons/auction/wizard/__init__.py index 957ab02b053..41ada315889 100644 --- a/addons/auction/wizard/__init__.py +++ b/addons/auction/wizard/__init__.py @@ -31,8 +31,10 @@ import auction_lots_sms_send import auction_catalog_flagey_report #import auction_lots_cancel #import auction_transfer_unsold_object +#import auction_aie_send #import auction_aie_send_result import auction_lots_buyer_map +#import auction_lots_numerotate # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/wizard/auction_aie_send.py b/addons/auction/wizard/auction_aie_send.py new file mode 100644 index 00000000000..51368349a98 --- /dev/null +++ b/addons/auction/wizard/auction_aie_send.py @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +# +# Does not properly work concurrently !!! +# +import base64 +import mimetypes +import httplib +import threading +from tools.translate import _ +from osv import fields,osv + +class auction_lots_send_aie(osv.osv_memory): + _name = 'auction.lots.send.aie' + _descritption = 'Send to website' + + def _date_get(self, cr, uid, context={}): + selection = context and context.get('selection') + if selection: + return [('','')] + selection + return [('','')] + + _columns = { + 'uname': fields.char('Login', size=64), + 'password': fields.char('Password', size=64), + 'objects': fields.integer('# of objects', readonly=True), + 'lang': fields.selection([('fr','fr'),('ned','ned'),('eng','eng'),('de','de')],'Language'), + 'numerotation': fields.selection([('prov','Provisoire'),('definite','Definitive (ordre catalogue)')],'Numerotation'), + 'dates': fields.selection(_date_get,'Auction Date'), + 'img_send': fields.boolean('Send Image also ?'), + } + + def default_get(self, cr, uid, fields, context): + """ + To get default values for the object. + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param fields: List of fields for which we want default values + @param context: A standard dictionary + @return: A dictionary which of fields with values. + """ + res = super(auction_lots_send_aie, self).default_get(cr, uid, fields, context=context) + if 'uname' in fields and context.get('uname',False): + res['uname'] = context.get('uname') + if 'password' in fields and context.get('password',False): + res['password'] = context.get('password') + return res + + def _catalog_send(uname, passwd, lang, did, catalog): + def post_multipart(host, selector, fields, files): + def encode_multipart_formdata(fields, files): + BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' + CRLF = '\r\n' + L = [] + for (key, value) in fields: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"' % key) + L.append('') + L.append(value) + for (key,value) in files: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle')) + L.append('Content-Type: application/octet-stream') + L.append('') + L.append(value) + L.append('--' + BOUNDARY + '--') + L.append('') + body = CRLF.join(L) + content_type = 'multipart/form-data; boundary=%s' % BOUNDARY + return content_type, body + content_type, body = encode_multipart_formdata(fields, files) + import httplib + + headers = {"Content-type": content_type, "Accept": "*/*"} + conn = httplib.HTTPConnection(host) + conn.request("POST", '/bin/catalog.cgi', body, headers = headers) + response = conn.getresponse() + val = response.status + conn.close() + return val + return post_multipart('auction-in-europe.com', "/bin/catalog.cgi", (('uname',uname),('password',passwd),('did',did),('lang',lang)),(('file',catalog),)) + + def _photo_bin_send(uname, passwd, ref, did, photo_name, photo_data): + def get_content_type(filename): + return mimetypes.guess_type(filename)[0] or 'application/octet-stream' + + def post_multipart(host, selector, fields, files): + def encode_multipart_formdata(fields, files): + BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' + CRLF = '\r\n' + L = [] + for (key, value) in fields: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"' % key) + L.append('') + L.append(value) + for (key, filename, data) in files: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)) + L.append('Content-Type: %s' % get_content_type(filename)) + L.append('') + L.append(data) + L.append('--' + BOUNDARY + '--') + L.append('') + body = CRLF.join(L) + content_type = 'multipart/form-data; boundary=%s' % BOUNDARY + return content_type, body + content_type, body = encode_multipart_formdata(fields, files) + + headers = {"Content-type": content_type, "Accept": "*/*"} + conn = httplib.HTTPConnection(host) + conn.request("POST", '/bin/photo.cgi', body, headers = headers) + response = conn.getresponse() + val = response.status + conn.close() + return val + return post_multipart('auction-in-europe.com', "/bin/photo.cgi", (('uname',uname),('ref',ref),('passwd',passwd),('did',did)),(('file',photo_name,photo_data),)) + + + def _photos_send(cr, uid, uname, passwd, did, ids): + service = netsvc.LocalService("object_proxy") + for (ref,id) in ids: + + # ids_attach = service.execute(db_name,uid, 'ir.attachment', 'search', [('res_model','=','auction.lots'), ('res_id', '=',id)]) + datas = service.execute(cr.db_name,uid, 'auction.lots', 'read',[id], ['name','image']) + if len(datas): + bin = base64.decodestring(datas[0]['image']) + fname = datas[0]['name'] + _photo_bin_send(uname, passwd, ref, did, fname, bin) + + def get_dates(self, cr, uid, ids, context={}): + import httplib + data_obj = self.pool.get('ir.model.data') + conn = httplib.HTTPConnection('www.auction-in-europe.com') + datas = self.read(cr, uid, ids[0],['uname','password']) + conn.request("GET", "/aie_upload/dates_get.php?uname=%s&passwd=%s" % (datas['uname'], datas['password'])) + response = conn.getresponse() + if response.status == 200: + def _date_decode(x): + return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1','replace').encode('utf-8','replace'))) + context['selection'] = map(_date_decode, response.read().split('\n')) + self._date_get(cr, uid, context=context) + else: + raise osv.except_osv(_('Error'), _("Connection to WWW.Auction-in-Europe.com failed !")) + id1 = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_send') + res_id = data_obj.browse(cr, uid, id1, context=context).res_id + context.update(datas) + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'auction.lots.send.aie', + 'views': [(res_id,'form')], + 'type': 'ir.actions.act_window', + 'target':'new', + 'context': context + } + + def _send(self, cr, uid, ids, context={}): + import pickle, thread, sql_db + cr.execute('select name,aie_categ from auction_lot_category') + vals = dict(cr.fetchall()) + cr.close() + + service = netsvc.LocalService("object_proxy") + lots = service.execute(cr.dbname, uid, 'auction.lots', 'read', context['active_ids'], ['obj_num','lot_num','obj_desc','bord_vnd_id','lot_est1','lot_est2','artist_id','lot_type','aie_categ']) + lots_ids = [] + datas = self.read(cr, uid, ids[0],['uname','login','lang','numerotation','dates']) + for l in lots: + if datas['numerotation']=='prov': + l['ref']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num']) + l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num']) + else: + l['ref']='%04d' % (l['obj_num'],) + l['ref2']='%s%03d' % (l['bord_vnd_id'][1],l['lot_num']) + if l['artist_id']: + l['artist_id'] = l['artist_id'][1] + else: + l['artist_id'] = '' + for n in ('obj_desc','artist_id','lot_type'): + try: + l[n]=l[n].decode('utf-8','replace').encode('latin1','replace') + except: + l[n]='' + del l['lot_num'] + del l['obj_num'] + del l['bord_vnd_id'] + l['aie_categ'] = vals.get(l['lot_type'], False) + lots_ids.append((l['ref'], l['id'])) + args = pickle.dumps(lots) + thread.start_new_thread(_catalog_send, (datas['uname'],datas['password'],datas['lang'],datas['dates'], args)) + if(datas['form']['img_send']==True): + thread.start_new_thread(_photos_send, (cr.dbname, uid, datas['uname'], datas['password'],datas['dates'], lots_ids)) + return {} + + def send_pdf(self, cr, uid, ids, context): + threaded_calculation = threading.Thread(target=self._send, args=(cr, uid, ids, context)) + threaded_calculation.start() + return {} + +auction_lots_send_aie() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/auction/wizard/auction_aie_send_result.py b/addons/auction/wizard/auction_aie_send_result.py new file mode 100644 index 00000000000..404881b2d6b --- /dev/null +++ b/addons/auction/wizard/auction_aie_send_result.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +# +# Does not properly work concurrently !!! +# + +import netsvc +from tools.translate import _ +from osv import fields, osv + +class auction_lots_pay(osv.osv_memory): + _name = 'auction.lots.send.aie.results' + _description = 'Send results to Auction-in-europe.com' + + + def _date_get(self, cr, uid, context={}): + selection = context and context.get('selection') + if selection: + return [('','')] + selection + return [('','')] + + _columns = { + 'uname': fields.char('Login', size=64), + 'password': fields.char('Password', size=64), + 'objects': fields.integer('# of objects'), + 'dates': fields.selection(_date_get,'Auction Date'), + } + + def default_get(self, cr, uid, fields, context): + """ + To get default values for the object. + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param fields: List of fields for which we want default values + @param context: A standard dictionary + @return: A dictionary which of fields with values. + """ + res = super(auction_lots_pay, self).default_get(cr, uid, fields, context=context) + if 'uname' in fields and context.get('uname',False): + res['uname'] = context.get('uname') + if 'password' in fields and context.get('password',False): + res['password'] = context.get('password') + return res + + def _catalog_send(self, uname, passwd, did, catalog): + def post_multipart(host, selector, fields, files): + def encode_multipart_formdata(fields, files): + BOUNDARY = '----------ThIs_Is_tHe_bouNdaRY_$' + CRLF = '\r\n' + L = [] + for (key, value) in fields: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"' % key) + L.append('') + L.append(value) + for (key,value) in files: + L.append('--' + BOUNDARY) + L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, key+'.pickle')) + L.append('Content-Type: application/octet-stream') + L.append('') + L.append(value) + L.append('--' + BOUNDARY + '--') + L.append('') + body = CRLF.join(L) + content_type = 'multipart/form-data; boundary=%s' % BOUNDARY + return content_type, body + content_type, body = encode_multipart_formdata(fields, files) + import httplib + + headers = {"Content-type": content_type, "Accept": "*/*"} + conn = httplib.HTTPConnection(host) + conn.request("POST", '/bin/catalog_result.cgi', body, headers = headers) + response = conn.getresponse() + val = response.status + conn.close() + return val + return post_multipart('auction-in-europe.com', "/bin/catalog_result.cgi", (('uname',uname),('password',passwd),('did',did)),(('file',catalog),)) + + def get_dates(self, cr, uid, ids, context): + import httplib + conn = httplib.HTTPConnection('www.auction-in-europe.com') + data_obj = self.pool.get('ir.model.data') + datas = self.read(cr, uid, ids[0],['uname','password']) + conn.request("GET", "/aie_upload/dates_get_result.php?uname=%s&passwd=%s" % (datas['uname'], datas['password'])) + response = conn.getresponse() + if response.status == 200: + def _date_decode(x): + return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1').encode('utf-8'))) + context['selection'] = map(_date_decode, response.read().split('\n')) + self._date_get(cr, uid, context=context) + else: + raise osv.except_osv(_('Error'), + _("Connection to WWW.Auction-in-Europe.com failed !")) + id1 = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_send_result_send') + res_id = data_obj.browse(cr, uid, id1, context=context).res_id + context.update(datas) + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'auction.lots.send.aie.results', + 'views': [(res_id,'form')], + 'type': 'ir.actions.act_window', + 'target':'new', + 'context': context + } + + def send(self, cr, uid, ids, context): + import pickle + service = netsvc.LocalService("object_proxy") + datas = self.read(cr, uid, ids[0],['uname','password','dates']) + lots = service.execute(cr.dbname, uid, 'auction.lots', 'read', context['active_ids'], ['obj_num','obj_price']) + args = pickle.dumps(lots) + self._catalog_send(datas['uname'], datas['password'], datas['dates'], args) + return {} + +auction_lots_pay() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/auction/wizard/auction_aie_send_result_view.xml b/addons/auction/wizard/auction_aie_send_result_view.xml new file mode 100644 index 00000000000..7056e88b20e --- /dev/null +++ b/addons/auction/wizard/auction_aie_send_result_view.xml @@ -0,0 +1,58 @@ + + + + + + + + Auction lots send result - Login + auction.lots.send.aie.results + form + +
+ + + + +