diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 5946661136f..1af3f1bef1e 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -376,7 +376,7 @@ - + diff --git a/addons/account/i18n/it.po b/addons/account/i18n/it.po index 80b62684781..413cbb3ad35 100644 --- a/addons/account/i18n/it.po +++ b/addons/account/i18n/it.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-07-06 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-07-07 03:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index ab7884cfa0a..743c8ff302e 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-07-06 03:17+0000\n" +"PO-Revision-Date: 2010-07-06 10:39+0000\n" "Last-Translator: Black Jack \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-07-06 03:37+0000\n" +"X-Launchpad-Export-Date: 2010-07-07 03:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -45,7 +45,7 @@ msgstr "设置过期支付的催款信息" #. module: account #: model:process.transition,name:account.process_transition_confirmstatementfromdraft0 msgid "Confirm statement from draft" -msgstr "从草稿确认" +msgstr "从草稿确认对帐单" #. module: account #: model:account.account.type,name:account.account_type_asset @@ -60,7 +60,7 @@ msgstr "在动作定义使用了无效的模块名。" #. module: account #: help:account.journal,currency:0 msgid "The currency used to enter statement" -msgstr "报表使用的货币" +msgstr "使用的货币" #. module: account #: wizard_view:account_use_models,init_form:0 @@ -454,7 +454,7 @@ msgstr "特殊计算" #. module: account #: model:process.transition,note:account.process_transition_confirmstatementfromdraft0 msgid "Confirm statement with/without reconciliation from draft statement" -msgstr "从草稿确认将不对账" +msgstr "从草稿确认与对/不对帐" #. module: account #: wizard_view:account.move.bank.reconcile,init:0 @@ -487,7 +487,7 @@ msgstr "税用在" msgid "" "Set if the amount of tax must be included in the base amount before " "computing the next taxes." -msgstr "如果这税额必须包含在计算下一个税的基础金额里, 请设置" +msgstr "如果这税额必须在计算下一个税的基础金额里, 请设置" #. module: account #: model:ir.ui.menu,name:account.menu_finance_periodical_processing @@ -954,7 +954,7 @@ msgstr "默认借方科目" #: model:ir.actions.act_window,name:account.action_bank_statement_tree #: model:ir.ui.menu,name:account.menu_bank_statement_tree msgid "Entries by Statements" -msgstr "银行对帐单" +msgstr "对帐单" #. module: account #: model:process.transition,name:account.process_transition_analyticinvoice0 @@ -1092,7 +1092,7 @@ msgstr "含税价计算代码" #: model:ir.actions.act_window,name:account.action_tax_code_list #: model:ir.ui.menu,name:account.menu_action_tax_code_list msgid "Tax codes" -msgstr "税代码" +msgstr "税事务" #. module: account #: field:account.fiscal.position.template,chart_template_id:0 @@ -1739,7 +1739,7 @@ msgstr "成本分类账的会计期间" #: model:ir.actions.act_window,name:account.action_bank_statement_tree2 #: model:ir.ui.menu,name:account.menu_bank_statement_tree2 msgid "New Statement" -msgstr "新银行对帐单" +msgstr "新对帐单" #. module: account #: wizard_field:account.analytic.account.chart,init,from_date:0 @@ -2581,7 +2581,7 @@ msgstr "应付账" #. module: account #: wizard_view:populate_statement_from_inv,init:0 msgid "Import Invoices in Statement" -msgstr "在银行对帐单里导入发票" +msgstr "在对帐单里导入发票" #. module: account #: view:account.invoice:0 @@ -2873,12 +2873,12 @@ msgstr "跳过'草稿'状态创建分录" #: field:account.invoice.tax,account_id:0 #: field:account.move.line,tax_code_id:0 msgid "Tax Account" -msgstr "税科目" +msgstr "税事务" #. module: account #: model:process.transition,note:account.process_transition_statemententries0 msgid "From statement, create entries" -msgstr "从对账单创建分录" +msgstr "从对帐单创建分录" #. module: account #: field:account.analytic.account,complete_name:0 @@ -2913,7 +2913,7 @@ msgstr "会计报表" #. module: account #: rml:account.overdue:0 msgid "Document: Customer account statement" -msgstr "文档:客户报表" +msgstr "文档:客户科目" #. module: account #: view:product.product:0 @@ -3003,7 +3003,7 @@ msgid "" "The maturity date of the generated entries for this model. You can chosse " "between the date of the creation action or the the date of the creation of " "the entries plus the partner payment terms." -msgstr "这模型在到期日产生分录. 你能从创建日期到到付款期限间选择." +msgstr "这模型在付款到期日产生分录. 你能从创建日期到到付款期限间选择." #. module: account #: selection:account.analytic.journal,type:0 @@ -3212,7 +3212,7 @@ msgstr "平均汇率" #: model:process.node,note:account.process_node_bankstatement0 #: model:process.node,note:account.process_node_supplierbankstatement0 msgid "Statement encoding produces payment entries" -msgstr "产品付款分录清单" +msgstr "产品付款分录对帐单" #. module: account #: field:account.account,code:0 @@ -3694,7 +3694,7 @@ msgstr "周期性分录科目" #: field:account.move.line,date_maturity:0 #: rml:account.overdue:0 msgid "Maturity date" -msgstr "到期日期" +msgstr "付款到期日" #. module: account #: view:account.subscription:0 @@ -3798,7 +3798,7 @@ msgstr "付款分录" #. module: account #: help:account.move.line,tax_code_id:0 msgid "The Account can either be a base tax code or tax code account." -msgstr "这科目可以选基础税的代码或税代码科目" +msgstr "可以选基于的税务代码或税务代码" #. module: account #: help:account.automatic.reconcile,init,account_ids:0 @@ -4011,7 +4011,7 @@ msgstr "凭证" #: view:account.bank.statement:0 #: field:account.bank.statement,line_ids:0 msgid "Statement lines" -msgstr "银行对帐单明细" +msgstr "对帐单明细" #. module: account #: field:account.move.line,amount_taxed:0 @@ -4182,7 +4182,7 @@ msgstr "报表上显示的会计年度名称" msgid "" "This field is used for payable and receivable entries. You can put the limit " "date for the payment of this entry line." -msgstr "这字段用于应付和应收分录. 你可以在付款分录明细放入的限制日期" +msgstr "这字段用于应付和应收分录. 你可以放入该分录明细的付款限定日期" #. module: account #: rml:account.tax.code.entries:0 @@ -4552,7 +4552,7 @@ msgstr "将根据选择的模板自动设置你的科目一览表、银行帐号 #: field:account.bank.statement.line,statement_id:0 #: field:account.move.line,statement_id:0 msgid "Statement" -msgstr "银行对帐单" +msgstr "对帐单" #. module: account #: model:ir.actions.act_window,name:account.action_move_line_form_encode_by_move @@ -4622,12 +4622,12 @@ msgstr "运行中" msgid "" "Indicate if the amount of tax must be included in the base amount for the " "computation of the next taxes" -msgstr "表明如果税额必须包含在计算下一个税的基础金额里" +msgstr "指出如果税额必须在计算下一个税的基础金额里" #. module: account #: model:process.node,name:account.process_node_draftstatement0 msgid "Draft statement" -msgstr "银行对帐单草稿" +msgstr "对帐单草稿" #. module: account #: field:account.analytic.journal,name:0 @@ -4637,7 +4637,7 @@ msgstr "分录集合名称" #. module: account #: model:process.transition,note:account.process_transition_invoiceimport0 msgid "Import invoice from statement" -msgstr "从银行对帐单导入发票" +msgstr "从对帐单导入发票" #. module: account #: selection:account.automatic.reconcile,init,power:0 @@ -4730,7 +4730,7 @@ msgstr "已取消" #: model:ir.actions.act_window,name:account.action_bank_statement_draft_tree #: model:ir.ui.menu,name:account.menu_bank_statement_draft_tree msgid "Draft statements" -msgstr "银行对帐单草稿" +msgstr "对帐单草稿" #. module: account #: wizard_field:populate_statement_from_inv,init,date:0 @@ -5887,7 +5887,7 @@ msgstr "财务结构" #. module: account #: model:process.process,name:account.process_process_statementprocess0 msgid "Statement Process" -msgstr "银行对帐单处理" +msgstr "对帐单处理" #. module: account #: model:ir.model,name:account.model_account_bank_statement_reconcile diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 25673dff42c..4337bdc61af 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -88,3 +88,6 @@ "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_account_account_report_manager","account.account.report","model_account_account_report","account.group_account_manager",1,0,0,0 +"access_account_entries_report_manager","account.entries.report","model_account_entries_report","account.group_account_manager",1,0,0,0 +"access_analytic_entries_report_manager","analytic.entries.report","model_analytic_entries_report","account.group_account_manager",1,0,0,0 diff --git a/addons/account/wizard/account_statement_from_invoice.py b/addons/account/wizard/account_statement_from_invoice.py index 00462e8fb26..c216fc88a6a 100644 --- a/addons/account/wizard/account_statement_from_invoice.py +++ b/addons/account/wizard/account_statement_from_invoice.py @@ -58,14 +58,19 @@ class account_statement_from_invoice_lines(osv.osv_memory): # else: ctx['date'] = line_date amount = 0.0 + + if line.debit > 0: + amount = line.debit + elif line.credit > 0: + amount = -line.credit + if line.amount_currency: - amount = currency_obj.compute(cr, uid, line.currency_id.id, + amount = currency_obj.compute(cursor, user, line.currency_id.id, statement.currency.id, line.amount_currency, context=ctx) - else: - if line.debit > 0: - amount=line.debit - elif line.credit > 0: - amount=-line.credit + elif (line.invoice and line.invoice.currency_id.id <> statement.currency.id): + amount = currency_obj.compute(cursor, user, line.invoice.currency_id.id, + statement.currency.id, amount, context=ctx) + reconcile_id = statement_reconcile_obj.create(cr, uid, { 'line_ids': [(6, 0, [line.id])] }, context=context) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 4ad34f5b2cc..a7fee587057 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -200,7 +200,7 @@ class account_analytic_account(osv.osv): res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res - def _last_worked_date_calc (self, cr, uid, ids, name, arg, context = None): + def _last_worked_date_calc (self, cr, uid, ids, name, arg, context=None): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: @@ -384,6 +384,7 @@ class account_analytic_account(osv.osv): 'month_ids': fields.function(_month, method=True, type='many2many', relation='account_analytic_analysis.summary.month', string='Month'), 'user_ids': fields.function(_user, method=True, type="many2many", relation='account_analytic_analysis.summary.user', string='User'), } + account_analytic_account() class account_analytic_account_summary_user(osv.osv): @@ -507,11 +508,11 @@ class account_analytic_account_summary_user(osv.osv): res.extend(cr.dictfetchall()) else: res = map(lambda x: {'id': x}, ids) - + res_trans_obj = self.pool.get('ir.translation') for f in fields_pre: if self._columns[f].translate: ids = map(lambda x: x['id'], res) - res_trans = self.pool.get('ir.translation')._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids) + res_trans = res_trans_obj._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids) for r in res: r[f] = res_trans.get(r['id'], False) or r[f] @@ -683,11 +684,12 @@ class account_analytic_account_summary_month(osv.osv): res.extend(cr.dictfetchall()) else: res = map(lambda x: {'id': x}, ids) - + + res_trans_obj = self.pool.get('ir.translation') for f in fields_pre: if self._columns[f].translate: ids = map(lambda x: x['id'], res) - res_trans = self.pool.get('ir.translation')._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids) + res_trans = res_trans_obj._get_ids(cr, user, self._name+','+f, 'model', context.get('lang', False) or 'en_US', ids) for r in res: r[f] = res_trans.get(r['id'], False) or r[f] diff --git a/addons/account_analytic_analysis/i18n/nb.po b/addons/account_analytic_analysis/i18n/nb.po index d847419e188..ca34e1040b7 100644 --- a/addons/account_analytic_analysis/i18n/nb.po +++ b/addons/account_analytic_analysis/i18n/nb.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-07-04 03:45+0000\n" +"X-Launchpad-Export-Date: 2010-07-07 03:39+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_analytic_analysis diff --git a/addons/account_analytic_default/__openerp__.py b/addons/account_analytic_default/__openerp__.py index 537721a112e..3f735ebaa6c 100644 --- a/addons/account_analytic_default/__openerp__.py +++ b/addons/account_analytic_default/__openerp__.py @@ -33,7 +33,7 @@ Allows to automatically select analytic accounts based on criterions: """, 'author' : 'Tiny', 'website' : 'http://www.openerp.com', - 'depends' : ['account', 'sale'], + 'depends' : ['sale'], 'init_xml' : [], 'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'], 'demo_xml' : [], diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index 6df4ed83614..43e3d2eb248 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -38,6 +38,7 @@ class account_analytic_default(osv.osv): 'date_start': fields.date('Start Date'), 'date_stop': fields.date('End Date'), } + def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context=None): domain = [] if product_id: @@ -65,20 +66,22 @@ class account_analytic_default(osv.osv): res = rec best_index = index return res + account_analytic_default() class account_invoice_line(osv.osv): _inherit = '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=None): - 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) + def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fiscal_position=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None): + res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fiscal_position, price_unit, address_invoice_id, currency_id=currency_id, context=context) rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context) if rec: res_prod['value'].update({'account_analytic_id':rec.analytic_id.id}) else: res_prod['value'].update({'account_analytic_id':False}) return res_prod + account_invoice_line() @@ -105,14 +108,14 @@ class sale_order_line(osv.osv): 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') - - for line in pool_inv_line.browse(cr, uid, create_ids, context): - rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) + sale_line = self.browse(cr, uid, ids[0], context) + inv_line_obj = self.pool.get('account.invoice.line') + anal_def_obj = self.pool.get('account.analytic.default') + for line in inv_line_obj.browse(cr, uid, create_ids, context): + rec = anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) if rec: - pool_inv_line.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context) + inv_line_obj.write(cr, uid, [line.id], {'account_analytic_id':rec.analytic_id.id}, context=context) return create_ids sale_order_line() diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 0cfbac974e6..535f9aef601 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -53,6 +53,7 @@ class account_analytic_plan(osv.osv): 'name': fields.char('Analytic Plan', size=64, required=True, select=True,), 'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'), } + account_analytic_plan() class account_analytic_plan_line(osv.osv): @@ -71,6 +72,7 @@ class account_analytic_plan_line(osv.osv): 'min_required': 100.0, 'max_required': 100.0, } + account_analytic_plan_line() class account_analytic_plan_instance(osv.osv): @@ -187,16 +189,18 @@ class account_analytic_plan_instance(osv.osv): pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)]) if pids: raise osv.except_osv(_('Error'), _('A model having this name and code already exists !')) - - res = self.pool.get('account.analytic.plan.line').search(cr, uid, [('plan_id','=',journal.plan_id.id)]) + + acct_anal_acct = self.pool.get('account.analytic.account') + acct_anal_plan_line_obj = self.pool.get('account.analytic.plan.line') + res = acct_anal_plan_line_obj.search(cr, uid, [('plan_id','=',journal.plan_id.id)]) for i in res: total_per_plan = 0 - item = self.pool.get('account.analytic.plan.line').browse(cr, uid, i) + item = acct_anal_plan_line_obj.browse(cr, uid, i) temp_list=['account1_ids','account2_ids','account3_ids','account4_ids','account5_ids','account6_ids'] for l in temp_list: if vals.has_key(l): for tempo in vals[l]: - if self.pool.get('account.analytic.account').search(cr, uid, [('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]): + if acct_anal_acct.search(cr, uid, [('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]): total_per_plan += tempo[2]['rate'] if total_per_plan < item.min_required or total_per_plan > item.max_required: raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s') % (str(item.min_required), str(item.max_required))) @@ -252,6 +256,7 @@ class account_journal(osv.osv): _columns = { 'plan_id':fields.many2one('account.analytic.plan', 'Analytic Plans'), } + account_journal() class account_invoice_line(osv.osv): @@ -277,6 +282,7 @@ class account_invoice_line(osv.osv): if rec and rec.analytics_id: res_prod['value'].update({'analytics_id':rec.analytics_id.id}) return res_prod + account_invoice_line() class account_move_line(osv.osv): @@ -345,6 +351,7 @@ class account_invoice(osv.osv): sign = -1 iml = self.pool.get('account.invoice.line').move_line_get(cr, uid, inv.id) + acct_ins_obj = self.pool.get('account.analytic.plan.instance') for il in iml: if il['analytics_id']: @@ -353,14 +360,14 @@ class account_invoice(osv.osv): ref = inv.reference else: ref = self._convert_ref(cr, uid, inv.number) - obj_move_line=self.pool.get('account.analytic.plan.instance').browse(cr, uid, il['analytics_id']) - amount_calc=cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, il['price'], context={'date': inv.date_invoice}) * sign - qty=il['quantity'] + obj_move_line = acct_ins_obj.browse(cr, uid, il['analytics_id']) + amount_calc = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, il['price'], context={'date': inv.date_invoice}) * sign + qty = il['quantity'] il['analytic_lines']=[] for line2 in obj_move_line.account_ids: - amt=amount_calc * (line2.rate/100) - qtty=qty* (line2.rate/100) - al_vals={ + amt = amount_calc * (line2.rate/100) + qtty = qty* (line2.rate/100) + al_vals = { 'name': il['name'], 'date': inv['date_invoice'], 'unit_amount':qtty, @@ -389,6 +396,7 @@ class analytic_default(osv.osv): _columns = { 'analytics_id': fields.many2one('account.analytic.plan.instance', 'Analytic Distribution'), } + analytic_default() class sale_order_line(osv.osv): @@ -398,14 +406,15 @@ class sale_order_line(osv.osv): def invoice_line_create(self, cr, uid, ids, context=None): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) if ids: - sale_line_obj = self.browse(cr, uid, ids[0], context) - pool_inv_line = self.pool.get('account.invoice.line') - - for line in pool_inv_line.browse(cr, uid, create_ids, context): - rec = self.pool.get('account.analytic.default').account_get(cr, uid, line.product_id.id, sale_line_obj.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) + sale_line = self.browse(cr, uid, ids[0], context) + inv_line_obj = self.pool.get('account.invoice.line') + acct_anal_def_obj = self.pool.get('account.analytic.default') + + for line in inv_line_obj.browse(cr, uid, create_ids, context): + rec = acct_anal_def_obj.account_get(cr, uid, line.product_id.id, sale_line.order_id.partner_id.id, uid, time.strftime('%Y-%m-%d'), context) if rec: - pool_inv_line.write(cr, uid, [line.id], {'analytics_id':rec.analytics_id.id}, context=context) + inv_line_obj.write(cr, uid, [line.id], {'analytics_id':rec.analytics_id.id}, context=context) return create_ids sale_order_line() diff --git a/addons/account_anglo_saxon/__init__.py b/addons/account_anglo_saxon/__init__.py index dd9a9262710..07b514d0327 100644 --- a/addons/account_anglo_saxon/__init__.py +++ b/addons/account_anglo_saxon/__init__.py @@ -22,4 +22,5 @@ import product import stock import purchase import invoice + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_anglo_saxon/__openerp__.py b/addons/account_anglo_saxon/__openerp__.py index 7a867d2a6a9..735bc9e0007 100644 --- a/addons/account_anglo_saxon/__openerp__.py +++ b/addons/account_anglo_saxon/__openerp__.py @@ -17,11 +17,12 @@ # along with this program. If not, see . # ############################################################################## + { - "name" : "Stock Accounting for Anglo Saxon countries", - "version" : "1.2", - "author" : "Tiny, Veritos", - "website" : "http://tinyerp.com - http://veritos.nl", + "name" : "Stock Accounting for Anglo Saxon countries", + "version" : "1.2", + "author" : "Tiny, Veritos", + "website" : "http://tinyerp.com - http://veritos.nl", "description" : """This module will support the Anglo-Saxons accounting methodology by changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales. @@ -29,12 +30,13 @@ This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account when the invoice is created to transfer this amount to the debtor or creditor account. Secondly, price differences between actual purchase price and fixed product standard price are booked on a seperate account""", - "depends" : ["product", "account", "sale", "purchase", "stock"], - "category" : "Generic Modules/Inventory Control", - "init_xml" : [], - "demo_xml" : [], + "depends" : ["product", "purchase"], + "category" : "Generic Modules/Inventory Control", + "init_xml" : [], + "demo_xml" : [], "update_xml" : ["product_view.xml",], - "active": False, + "active" : False, "installable": True } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_anglo_saxon/product_view.xml b/addons/account_anglo_saxon/product_view.xml index f744d5084b5..71288ad5c3b 100644 --- a/addons/account_anglo_saxon/product_view.xml +++ b/addons/account_anglo_saxon/product_view.xml @@ -5,13 +5,11 @@ product.normal.form.inherit.stock product.product form - + - - @@ -20,13 +18,11 @@ product.template.product.form.inherit product.template form - + - - @@ -41,8 +37,6 @@ - - diff --git a/addons/account_budget/__init__.py b/addons/account_budget/__init__.py index 4330278d2be..4eea62cb2d8 100644 --- a/addons/account_budget/__init__.py +++ b/addons/account_budget/__init__.py @@ -22,5 +22,6 @@ import crossovered_budget import report import wizard + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index 187d4999c0a..209e42ff32c 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -20,14 +20,9 @@ ############################################################################## from osv import osv,fields -import tools -import netsvc -from mx import DateTime -import time import datetime from tools.translate import _ - def strToDate(dt): dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10])) return dt_date @@ -127,13 +122,6 @@ class crossovered_budget(osv.osv): 'creating_user_id': lambda self,cr,uid,context: uid, } -# def action_set_to_draft(self, cr, uid, ids, *args): -# self.write(cr, uid, ids, {'state': 'draft'}) -# wf_service = netsvc.LocalService('workflow') -# for id in ids: -# wf_service.trg_create(uid, self._name, id, cr) -# return True - def budget_confirm(self, cr, uid, ids, *args): self.write(cr, uid, ids, { 'state':'confirm' diff --git a/addons/account_cancel/__openerp__.py b/addons/account_cancel/__openerp__.py index b38865f04ef..fda719a8178 100644 --- a/addons/account_cancel/__openerp__.py +++ b/addons/account_cancel/__openerp__.py @@ -19,17 +19,16 @@ # ############################################################################## - { "name" : "Account Cancel", "version" : "1.1", - "depends" : ["account"], "author" : "Tiny", "category": 'Generic Modules/Accounting', "description": """ - Module Add Allow cancelling entries field on form view of account journal if it set to true it allows user to cancel entries & invoices. + Module adds 'Allow cancelling entries' field on form view of account journal. If set to true it allows user to cancel entries & invoices. """, 'website': 'http://www.openerp.com', + "depends" : ["account"], 'init_xml': [], 'update_xml': ['account_cancel_view.xml' ], 'demo_xml': [], @@ -37,4 +36,5 @@ 'active': False, } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_cancel/account_cancel_view.xml b/addons/account_cancel/account_cancel_view.xml index 82eae01347c..bcb9fb4d34e 100644 --- a/addons/account_cancel/account_cancel_view.xml +++ b/addons/account_cancel/account_cancel_view.xml @@ -7,7 +7,7 @@ form - + diff --git a/addons/account_coda/__init__.py b/addons/account_coda/__init__.py index 8f76e8912b4..758417591e3 100644 --- a/addons/account_coda/__init__.py +++ b/addons/account_coda/__init__.py @@ -21,5 +21,6 @@ import account_coda import wizard + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_coda/__openerp__.py b/addons/account_coda/__openerp__.py index 5582955bf4f..2a7f30248bb 100644 --- a/addons/account_coda/__openerp__.py +++ b/addons/account_coda/__openerp__.py @@ -20,23 +20,24 @@ ############################################################################## { - "name":"Account CODA - import bank statements from coda file", - "version":"1.0", - "author":"Tiny", - "category":"Account CODA", - "description":""" + "name" : "Account CODA - import bank statements from coda file", + "version" : "1.0", + "author" : "Tiny", + "category" : "Account CODA", + "description": """ Module provides functionality to import bank statements from coda files. """, - "depends":["base", "account"], - "demo_xml":["account_coda_demo.xml"], - "init_xml":[], - "update_xml" : ["security/ir.model.access.csv", + "depends" : ["account"], + "demo_xml" : [], + "init_xml" : [], + "update_xml": ["security/ir.model.access.csv", "wizard/account_coda_import.xml", "account_coda_view.xml"], - "active":False, - "installable":True, + "active" : False, + "installable" : True, } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_coda/account_coda.py b/addons/account_coda/account_coda.py index 1cfd75ffb63..43d3db2a0ae 100644 --- a/addons/account_coda/account_coda.py +++ b/addons/account_coda/account_coda.py @@ -26,25 +26,26 @@ class account_coda(osv.osv): _name = "account.coda" _description = "coda for an Account" _columns = { - 'name': fields.binary('Coda file', readonly=True ,help="Store the detail of bank statements"), - 'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statements', readonly=True), + 'name': fields.binary('Coda file', readonly=True, help="Store the detail of bank statements"), + 'statement_ids': fields.one2many('account.bank.statement', 'coda_id', 'Generated Bank Statements', readonly=True), 'note': fields.text('Import log', readonly=True), - 'journal_id': fields.many2one('account.journal','Journal', readonly=True, select=True,help="Bank Journal"), + 'journal_id': fields.many2one('account.journal', 'Journal', readonly=True, select=True, help="Bank Journal"), 'date': fields.date('Date', readonly=True, select=True, help="Import Date"), - 'user_id': fields.many2one('res.users','User', readonly=True, select=True), + 'user_id': fields.many2one('res.users', 'User', readonly=True, select=True), } _defaults = { 'date': time.strftime('%Y-%m-%d'), 'user_id': lambda self,cr,uid,context: uid, } + account_coda() class account_bank_statement(osv.osv): _inherit = "account.bank.statement" _columns = { - 'coda_id':fields.many2one('account.coda','Coda'), + 'coda_id':fields.many2one('account.coda', 'Coda'), } + account_bank_statement() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_coda/statement_coda.txt b/addons/account_coda/test_coda_file/statement_coda.txt similarity index 100% rename from addons/account_coda/statement_coda.txt rename to addons/account_coda/test_coda_file/statement_coda.txt diff --git a/addons/account_coda/wizard/account_coda_import.py b/addons/account_coda/wizard/account_coda_import.py index de817d1a40d..297534542b1 100644 --- a/addons/account_coda/wizard/account_coda_import.py +++ b/addons/account_coda/wizard/account_coda_import.py @@ -21,7 +21,6 @@ ############################################################################## import time -from mx import DateTime import base64 from osv import fields @@ -54,7 +53,8 @@ class account_coda_import(osv.osv_memory): 'coda': fields.binary('Coda File', required=True), 'note':fields.text('Log'), } - def coda_parsing(self, cr, uid, ids, context): + + def coda_parsing(self, cr, uid, ids, context=None): journal_obj=self.pool.get('account.journal') account_period_obj = self.pool.get('account.period') @@ -65,10 +65,12 @@ class account_coda_import(osv.osv_memory): statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile') account_coda_obj = self.pool.get('account.coda') mod_obj = self.pool.get('ir.model.data') - + + if not context: + context = {} + data = self.read(cr, uid, ids)[0] - codafile = data['coda'] journal_code = journal_obj.browse(cr, uid, data['journal_id'], context).code @@ -265,6 +267,7 @@ class account_coda_import(osv.osv_memory): context.update({ 'statment_ids':bkst_list}) model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'account_coda_note_view')], context=context) resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + return { 'name': _('Result'), 'res_id': ids[0], @@ -277,7 +280,10 @@ class account_coda_import(osv.osv_memory): 'context': context, 'type': 'ir.actions.act_window', } - def action_open_window(self, cr, uid, data, context): + + def action_open_window(self, cr, uid, data, context=None): + if not context: + cotext = {} return { 'domain':"[('id','in',%s)]"%(context.get('statment_ids', False)), 'name': 'Statement', @@ -287,6 +293,7 @@ class account_coda_import(osv.osv_memory): 'view_id': False, 'type': 'ir.actions.act_window', } + account_coda_import() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_tax_include/__openerp__.py b/addons/account_tax_include/__openerp__.py index a963b0b5118..0981da4888e 100644 --- a/addons/account_tax_include/__openerp__.py +++ b/addons/account_tax_include/__openerp__.py @@ -40,4 +40,5 @@ This module implement the modification on the invoice form. 'active': False, 'certificate': '0070514190381', } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_tax_include/account_tax_include.py b/addons/account_tax_include/account_tax_include.py index 5cb58619a76..597050f9b2c 100644 --- a/addons/account_tax_include/account_tax_include.py +++ b/addons/account_tax_include/account_tax_include.py @@ -21,7 +21,6 @@ import time from osv import fields, osv -import decimal_precision as dp class account_invoice(osv.osv): _inherit = "account.invoice" @@ -117,7 +116,7 @@ class account_invoice_line(osv.osv): return super(account_invoice_line, self)._price_unit_default(cr, uid, context) return 0 - def _get_invoice(self, cr, uid, ids, context): + def _get_invoice(self, cr, uid, ids, context=None): result = {} for inv in self.pool.get('account.invoice').browse(cr, uid, ids, context=context): for line in inv.invoice_line: @@ -126,9 +125,9 @@ class account_invoice_line(osv.osv): _columns = { 'price_subtotal': fields.function(_amount_line2, method=True, string='Subtotal w/o tax', multi='amount', - store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}), + store={'account.invoice':(_get_invoice,['price_type'], 10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}), 'price_subtotal_incl': fields.function(_amount_line2, method=True, string='Subtotal', multi='amount', - store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}), + store={'account.invoice':(_get_invoice,['price_type'], 10), 'account.invoice.line': (lambda self, cr, uid, ids, c={}: ids, None,10)}), } _defaults = { diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 408df2ee031..aa2dd4cecd4 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -31,15 +31,10 @@ """, "category" : "Generic Modules/Accounting", "website" : "http://tinyerp.com", - "depends" : [ - "base", - "account" - ], - "init_xml" : [ - ], + "depends" : ["account"], + "init_xml" : [], - "demo_xml" : [ - ], + "demo_xml" : [], "update_xml" : [ "security/ir.model.access.csv", diff --git a/addons/account_voucher/security/ir.model.access.csv b/addons/account_voucher/security/ir.model.access.csv index 1291eeb4092..8ea4401d6d9 100644 --- a/addons/account_voucher/security/ir.model.access.csv +++ b/addons/account_voucher/security/ir.model.access.csv @@ -1,7 +1,5 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_account_voucher_user","account.voucher","model_account_voucher","account.group_account_user",1,0,0,0 "access_account_voucher_line_user","account.voucher.line","model_account_voucher_line","account.group_account_user",1,0,0,0 -"access_account_open_voucher_user","account.open.voucher","model_account_open_voucher","account.group_account_user",1,0,0,0 "access_account_voucher_manager","account.voucher","model_account_voucher","account.group_account_manager",1,1,1,1 "access_account_voucher_line_manager","account.voucher.line","model_account_voucher_line","account.group_account_manager",1,1,1,1 -"access_account_open_voucher_manager","account.open.voucher","model_account_open_voucher","account.group_account_manager",1,1,1,1 diff --git a/addons/account_voucher/voucher_view.xml b/addons/account_voucher/voucher_view.xml index 91038bba0bb..91cbbf007db 100644 --- a/addons/account_voucher/voucher_view.xml +++ b/addons/account_voucher/voucher_view.xml @@ -138,7 +138,7 @@ - Customer Vouchers + Receivable Vouchers account.voucher form tree,form @@ -151,7 +151,7 @@ - Vendor Vouchers + Payable Vouchers account.voucher form tree,form diff --git a/addons/account_voucher_payment/security/ir.model.access.csv b/addons/account_voucher_payment/security/ir.model.access.csv index 5ef781764a0..0343f29f43a 100644 --- a/addons/account_voucher_payment/security/ir.model.access.csv +++ b/addons/account_voucher_payment/security/ir.model.access.csv @@ -1,3 +1 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_account_voucher_unreconcile_user","account.voucher.unreconcile","model_account_voucher_unreconcile","account.group_account_user",1,0,0,0 -"access_account_voucher_unreconcile_manager","account.voucher.unreconcile","model_account_voucher_unreconcile","account.group_account_manager",1,1,1,1 diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv index 9dac045a449..642209edd05 100644 --- a/addons/auction/security/ir.model.access.csv +++ b/addons/auction/security/ir.model.access.csv @@ -22,4 +22,3 @@ "access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0 "access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0 "access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","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/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index 405c3155619..be1a53046a7 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -21,8 +21,6 @@ from datetime import datetime from osv import fields, osv, orm -from osv.orm import except_orm -from osv.osv import osv_pool from tools.translate import _ import mx.DateTime import pooler @@ -42,17 +40,14 @@ class base_action_rule(osv.osv): @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - return self.state_get(cr, uid, context=context) - def state_get(self, cr, uid, context={}): """ Get State @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - return [('', '')] def priority_get(self, cr, uid, context={}): @@ -61,14 +56,13 @@ class base_action_rule(osv.osv): @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - return [('', '')] _columns = { 'name': fields.many2one('ir.model', 'Object', required=True), 'max_level': fields.integer('Max Level', help='Specifies maximum level.'), 'create_date': fields.datetime('Create Date', readonly=1), - 'active': fields.boolean('Active', help="If the active field is set to true,\ + 'active': fields.boolean('Active', help="If the active field is set to False,\ it will allow you to hide the rule without removing it."), 'sequence': fields.integer('Sequence', help="Gives the sequence order \ when displaying a list of rules."), @@ -85,10 +79,7 @@ specifies you can put a negative number. If you need a delay before the \ trigger date, like sending a reminder 15 minutes before a meeting."), 'trg_date_range_type': fields.selection([('minutes', 'Minutes'), ('hour', 'Hours'), \ ('day', 'Days'), ('month', 'Months')], 'Delay type'), - - 'trg_user_id': fields.many2one('res.users', 'Responsible'), - 'trg_partner_id': fields.many2one('res.partner', 'Partner'), 'trg_partner_categ_id': fields.many2one('res.partner.category', 'Partner Category'), 'trg_state_from': fields.selection(_state_get, 'State', size=16), @@ -136,7 +127,9 @@ the rule to mark CC(mail to any other person defined in actions)."), def pre_action(self, cr, uid, ids, model, context=None): # Searching for action rules - cr.execute("SELECT model.model, rule.id FROM base_action_rule rule LEFT JOIN ir_model model on (model.id = rule.name)") + cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \ + LEFT JOIN ir_model model on (model.id = rule.name) \ + where active") res = cr.fetchall() # Check if any rule matching with current object for obj_name, rule_id in res: @@ -171,10 +164,9 @@ the rule to mark CC(mail to any other person defined in actions)."), def _register_hook(self, cr, uid, ids, context=None): if not context: context = {} - model_pool = self.pool.get('ir.model') for action_rule in self.browse(cr, uid, ids, context=context): model = action_rule.name.model - obj_pool = self.pool.get(model) + obj_pool = self.pool.get(model) obj_pool.__setattr__('create', self._create(obj_pool.create, model, context=context)) obj_pool.__setattr__('write', self._write(obj_pool.write, model, context=context)) return True @@ -194,7 +186,7 @@ the rule to mark CC(mail to any other person defined in actions)."), """ This Function is call by scheduler. """ - rule_pool= self.pool.get('base.action.rule') + rule_pool = self.pool.get('base.action.rule') rule_ids = rule_pool.search(cr, uid, [], context=context) return self._register_hook(cr, uid, rule_ids, context=context) @@ -202,7 +194,6 @@ the rule to mark CC(mail to any other person defined in actions)."), def format_body(self, body): """ Foramat Action rule's body @param self: The object pointer """ - return body and tools.ustr(body) or '' def format_mail(self, obj, body): @@ -392,7 +383,7 @@ the rule to mark CC(mail to any other person defined in actions)."), obj.date_action_next = dt model_obj.write(cr, uid, [obj.id], {'date_action_next': dt}, context) else: - ok = action.trg_date_type=='none' + ok = action.trg_date_type == 'none' if ok: self.do_action(cr, uid, action, model_obj, obj, context) @@ -431,7 +422,7 @@ class ir_cron(osv.osv): def _poolJobs(self, db_name, check=False): try: - db, pool = pooler.get_db_and_pool(db_name) + db = pooler.get_db(db_name) except: return False cr = db.cursor() @@ -439,12 +430,12 @@ class ir_cron(osv.osv): next = datetime.now().strftime('%Y-%m-%d %H:00:00') # Putting nextcall always less than current time in order to call it every time cr.execute('UPDATE ir_cron set nextcall = \'%s\' where numbercall<>0 and active and model=\'base.action.rule\' ' % (next)) - cr.commit() - res = super(ir_cron, self)._poolJobs(db_name, check=check) finally: cr.commit() cr.close() + super(ir_cron, self)._poolJobs(db_name, check=check) + ir_cron() diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index 4f502a4406b..c9164962439 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -57,22 +57,18 @@ - + + + + + + + - - - - - - - - - - + - diff --git a/addons/base_action_rule/security/ir.model.access.csv b/addons/base_action_rule/security/ir.model.access.csv index a8e43372e23..c3a69f93e4c 100644 --- a/addons/base_action_rule/security/ir.model.access.csv +++ b/addons/base_action_rule/security/ir.model.access.csv @@ -1,3 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_base_action_rule","base.action.rule","model_base_action_rule",,1,0,0,0 -"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,0,0,0 +"access_base_action_rule_config","base.action.rule config","model_base_action_rule",base.group_system,1,1,1,1 \ No newline at end of file diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 5bd0e01c113..5cee0052297 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -22,7 +22,7 @@ import time from datetime import datetime from datetime import timedelta - +import base64 import tools from osv import fields from osv import osv @@ -342,7 +342,6 @@ class crm_case(object): destination=False) def remind_user(self, cr, uid, ids, context={}, attach=False,destination=True): - """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -359,8 +358,9 @@ class crm_case(object): if case.section_id.reply_to and case.email_from: src = case.email_from dest = case.section_id.reply_to - body = "" - body = case.email_last or case.description + body = case.description or "" + if case.message_ids: + body = case.message_ids[0].description or "" if not destination: src, dest = dest, src if body and case.user_id.signature: @@ -371,7 +371,7 @@ class crm_case(object): attach_to_send = None if attach: - attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'mailgate.thread'), ('res_id', '=', case.id)]) + attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', self._name), ('res_id', '=', case.id)]) attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname','datas']) attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send) diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 2c0c5327e5d..1f11f2c4c0c 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -115,26 +115,22 @@ this if you want the rule to send an email to the partner."), def state_get(self, cr, uid, context={}): - - """@param self: The object pointer + """Gets available states for crm + @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - res = super(base_action_rule, self).state_get(cr, uid, context=context) return res + crm.AVAILABLE_STATES def priority_get(self, cr, uid, context={}): - """@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ - res = super(base_action_rule, self).priority_get(cr, uid, context=context) return res + crm.AVAILABLE_PRIORITIES - base_action_rule() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_action_rule_view.xml b/addons/crm/crm_action_rule_view.xml index 96f8d2f04bf..21bbef50e50 100644 --- a/addons/crm/crm_action_rule_view.xml +++ b/addons/crm/crm_action_rule_view.xml @@ -53,7 +53,7 @@ form - + diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml index 5336f52a000..7101473589b 100644 --- a/addons/crm/crm_lead_demo.xml +++ b/addons/crm/crm_lead_demo.xml @@ -12,7 +12,7 @@ lead - + @@ -21,13 +21,14 @@ + lead - + @@ -36,13 +37,14 @@ + lead - + @@ -67,13 +69,14 @@ + lead - + @@ -82,6 +85,7 @@ + @@ -91,7 +95,7 @@ lead - + @@ -107,7 +111,7 @@ lead - + @@ -115,5 +119,107 @@ + + + + + lead + + + + + + + + + + + + + + + + lead + + + + + + + + + + + + + + + + + lead + + + + + + + + + + + + + + + lead + + + + + + + + + + + + + + + + lead + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 4f68d2d2564..3ed7cf1f1fe 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -57,6 +57,8 @@ class crm_meeting(osv.osv, crm_case): 'id': fields.integer('ID'), 'create_date': fields.datetime('Creation Date' , readonly=True), 'write_date': fields.datetime('Write Date' , readonly=True), + 'date_action_last': fields.datetime('Last Action', readonly=1), + 'date_action_next': fields.datetime('Next Action', readonly=1), # Meeting fields 'categ_id': fields.many2one('crm.case.categ', 'Meeting Type', \ domain="[('object_id.model', '=', 'crm.meeting')]", \ diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 372b5214f6f..41aecc0bce0 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -33,7 +33,7 @@ class hr_employee_category(osv.osv): 'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories') } - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee_category where id IN %s', (tuple(ids), )) @@ -53,9 +53,10 @@ class hr_employee_marital_status(osv.osv): _name = "hr.employee.marital.status" _description = "Employee Marital Status" _columns = { - 'name': fields.char('Marital Status', size=30, required=True), + 'name': fields.char('Marital Status', size=32, required=True), 'description': fields.text('Status Description'), } + hr_employee_marital_status() class hr_job(osv.osv): @@ -95,11 +96,11 @@ class hr_employee(osv.osv): 'country_id': fields.many2one('res.country', 'Nationality'), 'birthday': fields.date("Birthday"), 'ssnid': fields.char('SSN No', size=32, help='Social Security Number'), - 'sinid': fields.char('SIN No', size=32), + 'sinid': fields.char('SIN No', size=32, help="Social Insurance Number"), 'otherid': fields.char('Other ID', size=32), 'gender': fields.selection([('male', 'Male'),('female', 'Female')], 'Gender'), 'marital': fields.many2one('hr.employee.marital.status', 'Marital Status'), - 'bank_account': fields.char('Bank Account', size=56), + 'bank_account': fields.char('Bank Account', size=64), 'partner_id': fields.related('company_id', 'partner_id', type='many2one', relation='res.partner', readonly=True), 'department_id':fields.many2one('hr.department','Department'), 'address_id': fields.many2one('res.partner.address', 'Working Address'), @@ -127,7 +128,7 @@ class hr_employee(osv.osv): 'photo': _get_photo, } - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),)) @@ -143,4 +144,4 @@ class hr_employee(osv.osv): hr_employee() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index d1e13e2f6ec..0a21e8aecee 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -39,7 +39,7 @@ class hr_department(osv.osv): return res def _dept_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.name_get(cr, uid, ids, context) + res = self.name_get(cr, uid, ids, context=context) return dict(res) _name = "hr.department" @@ -53,20 +53,20 @@ class hr_department(osv.osv): 'manager_id': fields.many2one('res.users', 'Manager', required=True), 'member_ids': fields.many2many('res.users', 'hr_department_user_rel', 'department_id', 'user_id', 'Members'), } - - _defaults = { + + _defaults = { 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.department', context=c), - } + } def _get_members(self,cr, uid, context=None): mids = self.search(cr, uid, [('manager_id', '=', uid)]) - result = {uid:1} - for m in self.browse(cr, uid, mids, context): + result = {uid: 1} + for m in self.browse(cr, uid, mids, context=context): for user in m.member_ids: result[user.id] = 1 return result.keys() - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from hr_department where id IN %s',(tuple(ids),)) @@ -122,12 +122,12 @@ class res_users(osv.osv): result[user_id] = parent_ids return result - def _parent_search(self, cr, uid, obj, name, args, context): + def _parent_search(self, cr, uid, obj, name, args, context=None): parent = [] for arg in args: if arg[0] == 'parent_id': parent = arg[2] - child_ids = self._child_compute(cr, uid, parent, name, args, {}) + child_ids = self._child_compute(cr, uid, parent, name, args, context=context) if not child_ids: return [('id', 'in', [0])] return [('id', 'in', child_ids.get(uid,[]))] @@ -163,7 +163,7 @@ class res_users(osv.osv): for arg in args: if arg[0] == 'child_ids': parent = arg[2] - child_ids = self._child_compute(cr, uid, parent, name, args, {}) + child_ids = self._child_compute(cr, uid, parent, name, args, context=context) if not child_ids: return [('id', 'in', [0])] return [('id', 'in', child_ids.get(uid,[]))] diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 161064723f9..402df16939e 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -89,6 +89,7 @@ + @@ -150,9 +151,20 @@ + + hr.hr.employee.marital.status.tree + hr.employee.marital.status + tree + + + + + + + hr.hr.employee.marital.status hr.employee.marital.status @@ -171,6 +183,7 @@ hr.employee.marital.status form tree,form + + @@ -358,7 +372,7 @@ - + diff --git a/addons/hr_attendance/security/ir.model.access.csv b/addons/hr_attendance/security/ir.model.access.csv index 54a15a7cc6e..c96ceff4c45 100644 --- a/addons/hr_attendance/security/ir.model.access.csv +++ b/addons/hr_attendance/security/ir.model.access.csv @@ -2,6 +2,5 @@ "access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr_attendance.group_hr_attendance",1,0,0,0 "access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_manager",1,1,1,1 "access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr_attendance.group_hr_attendance",1,1,1,1 -"access_hr_sign_in_out","hr attendance sign in out","model_hr_sign_in_out","hr_attendance.group_hr_attendance",1,1,1,1 "access_hr_attendance_employee","hr employee attendance sign in out","hr.model_hr_employee","hr_attendance.group_hr_attendance",1,0,0,0 "access_hr_attendance_resource","hr resource attendance sign in out","resource.model_resource_resource","hr_attendance.group_hr_attendance",1,0,0,0 diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index c04d7eb828a..bfc84d6750d 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -194,10 +194,10 @@ class payroll_register(osv.osv): # 'advice_ids':fields.one2many('hr.payroll.advice', 'register_id', 'Bank Advice'), 'company_id':fields.many2one('res.company', 'Company', required=False), 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."), - 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, int(config['price_accuracy']))), - 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, int(config['price_accuracy']))), - 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, int(config['price_accuracy']))), - 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, int(config['price_accuracy']))), + 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 4)), + 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 4)), + 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 4)), + 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, 4)), 'note': fields.text('Description'), } @@ -366,8 +366,8 @@ class payroll_advice_line(osv.osv): 'advice_id':fields.many2one('hr.payroll.advice', 'Bank Advice', required=False), 'name':fields.char('Bank Account A/C', size=64, required=True, readonly=False), 'employee_id':fields.many2one('hr.employee', 'Employee', required=True), - 'amount': fields.float('Amount', digits=(16, int(config['price_accuracy']))), - 'bysal': fields.float('By Salary', digits=(16, int(config['price_accuracy']))), + 'amount': fields.float('Amount', digits=(16, 4)), + 'bysal': fields.float('By Salary', digits=(16, 4)), 'flag':fields.char('D/C', size=8, required=True, readonly=False), } _defaults = { @@ -434,10 +434,10 @@ class contrib_register(osv.osv): 'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False), 'name':fields.char('Name', size=256, required=True, readonly=False), 'register_line_ids':fields.one2many('hr.contibution.register.line', 'register_id', 'Register Line', readonly=True), - 'yearly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, int(config['price_accuracy']))), - 'yearly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, int(config['price_accuracy']))), - 'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, int(config['price_accuracy']))), - 'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, int(config['price_accuracy']))), + 'yearly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, 4)), + 'yearly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, 4)), + 'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, 4)), + 'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, 4)), 'note': fields.text('Description'), } _defaults = { @@ -466,9 +466,9 @@ class contrib_register_line(osv.osv): 'code':fields.char('Code', size=64, required=False, readonly=False), 'employee_id':fields.many2one('hr.employee', 'Employee', required=True), 'period_id': fields.many2one('account.period', 'Period'), - 'emp_deduction': fields.float('Employee Deduction', digits=(16, int(config['price_accuracy']))), - 'comp_deduction': fields.float('Company Deduction', digits=(16, int(config['price_accuracy']))), - 'total': fields.function(_total, method=True, store=True, string='Total', digits=(16, int(config['price_accuracy']))), + 'emp_deduction': fields.float('Employee Deduction', digits=(16, 4)), + 'comp_deduction': fields.float('Company Deduction', digits=(16, 4)), + 'total': fields.function(_total, method=True, store=True, string='Total', digits=(16, 4)), } contrib_register_line() @@ -539,7 +539,7 @@ class company_contribution(osv.osv): ('fix','Fixed Amount'), ('func','Function Calculation'), ],'Amount Type', select=True), - 'contribute_per':fields.float('Contribution', digits=(16, int(config['price_accuracy'])), help='Define Company contribution ratio 1.00=100% contribution, If Employee Contribute 5% then company will and here 0.50 defined then company will contribute 50% on employee 5% contribution'), + 'contribute_per':fields.float('Contribution', digits=(16, 4), help='Define Company contribution ratio 1.00=100% contribution, If Employee Contribute 5% then company will and here 0.50 defined then company will contribute 50% on employee 5% contribution'), 'account_id':fields.property( 'account.account', type='many2one', @@ -596,13 +596,13 @@ class company_contribution_line(osv.osv): 'contribution_id':fields.many2one('company.contribution', 'Contribution', required=False), 'name':fields.char('Name', size=64, required=False, readonly=False), 'umo_id':fields.many2one('product.uom', 'Unite', required=False), - 'from_val': fields.float('From', digits=(16, int(config['price_accuracy']))), - 'to_val': fields.float('To', digits=(16, int(config['price_accuracy']))), + 'from_val': fields.float('From', digits=(16, 4)), + 'to_val': fields.float('To', digits=(16, 4)), 'amount_type':fields.selection([ ('fix','Fixed Amount'), ],'Amount Type', select=True), 'sequence':fields.integer('Sequence'), - 'value': fields.float('Value', digits=(16, int(config['price_accuracy']))), + 'value': fields.float('Value', digits=(16, 4)), } company_contribution_line() @@ -730,8 +730,8 @@ class hr_payslip(osv.osv): ('cancel','Reject'), ],'State', select=True, readonly=True), 'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits=(16, 2)), - 'leaves': fields.float('Leaved Deduction', readonly=True, digits=(16, 2)), - 'basic': fields.float('Basic Salary - Leaves', readonly=True, digits=(16, 2)), + 'leaves': fields.float('Leave Deductions', readonly=True, digits=(16, 2)), + 'basic': fields.float('Net Basic', readonly=True, digits=(16, 2)), 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 2)), 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 2)), 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 2)), @@ -1213,9 +1213,9 @@ class hr_payslip_line(osv.osv): 'amount': fields.float('Amount / Percentage', digits=(16, 4)), 'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account', required=False), 'account_id':fields.many2one('account.account', 'General Account', required=True), - 'total': fields.float('Sub Total', readonly=True, digits=(16, int(config['price_accuracy']))), + 'total': fields.float('Sub Total', readonly=True, digits=(16, 4)), #'total': fields.function(_calculate, method=True, type='float', string='Label', store=True), - 'company_contrib': fields.float('Company Contribution', readonly=True, digits=(16, int(config['price_accuracy']))), + 'company_contrib': fields.float('Company Contribution', readonly=True, digits=(16, 4)), 'expanse_id': fields.many2one('hr.expense.expense', 'Expense'), 'sequence': fields.integer('Sequence'), 'note':fields.text('Description'), @@ -1251,13 +1251,13 @@ class hr_payslip_line_line(osv.osv): 'slipline_id':fields.many2one('hr.payslip.line', 'Slip Line', required=False), 'name':fields.char('Name', size=64, required=False, readonly=False), 'umo_id':fields.many2one('product.uom', 'Unite', required=False), - 'from_val': fields.float('From', digits=(16, int(config['price_accuracy']))), - 'to_val': fields.float('To', digits=(16, int(config['price_accuracy']))), + 'from_val': fields.float('From', digits=(16, 4)), + 'to_val': fields.float('To', digits=(16, 4)), 'amount_type':fields.selection([ ('fix','Fixed Amount'), ],'Amount Type', select=True), 'sequence':fields.integer('Sequence'), - 'value': fields.float('Value', digits=(16, int(config['price_accuracy']))), + 'value': fields.float('Value', digits=(16, 4)), } hr_payslip_line_line() diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index f98247236ae..97b6ac70cee 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -505,7 +505,7 @@