diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py
index 44411cd637a..acb0e640a7a 100644
--- a/addons/account/account_bank.py
+++ b/addons/account/account_bank.py
@@ -65,12 +65,11 @@ class bank(osv.osv):
# Find the code and parent of the bank account to create
dig = 6
current_num = 1
- ids = obj_acc.search(cr, uid, [('type','=','liquidity'), ('company_id', '=', bank.company_id.id)], context=context)
+ ids = obj_acc.search(cr, uid, [('type','=','liquidity'), ('company_id', '=', bank.company_id.id), ('parent_id', '!=', False)], context=context)
# No liquidity account exists, no template available
if not ids: continue
- ref_acc_bank_temp = obj_acc.browse(cr, uid, ids[0], context=context)
- ref_acc_bank = ref_acc_bank_temp.parent_id
+ ref_acc_bank = obj_acc.browse(cr, uid, ids[0], context=context).parent_id
while True:
new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num)
ids = obj_acc.search(cr, uid, [('code', '=', new_code), ('company_id', '=', bank.company_id.id)])
@@ -82,7 +81,7 @@ class bank(osv.osv):
'name': name,
'code': new_code,
'type': 'liquidity',
- 'user_type': ref_acc_bank_temp.user_type.id,
+ 'user_type': ref_acc_bank.user_type.id,
'reconcile': False,
'parent_id': ref_acc_bank.id,
'company_id': bank.company_id.id,
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 01476374cf4..0fb6af05e58 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -51,9 +51,12 @@ class account_invoice(osv.osv):
company_id = context.get('company_id', user.company_id.id)
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
journal_obj = self.pool.get('account.journal')
- res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')),
- ('company_id', '=', company_id)],
- limit=1)
+ domain = [('company_id', '=', company_id)]
+ if isinstance(type_inv, list):
+ domain.append(('type', 'in', [type2journal.get(type) for type in type_inv if type2journal.get(type)]))
+ else:
+ domain.append(('type', '=', type2journal.get(type_inv, 'sale')))
+ res = journal_obj.search(cr, uid, domain, limit=1)
return res and res[0] or False
def _get_currency(self, cr, uid, context=None):
@@ -578,6 +581,10 @@ class account_invoice(osv.osv):
return {'value': {}}
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id, context=None):
+ #TODO: add the missing context parameter when forward-porting in trunk so we can remove
+ # this hack!
+ context = self.pool['res.users'].context_get(cr, uid)
+
val = {}
dom = {}
obj_journal = self.pool.get('account.journal')
@@ -634,14 +641,13 @@ class account_invoice(osv.osv):
else:
continue
if company_id and type:
- if type in ('out_invoice'):
- journal_type = 'sale'
- elif type in ('out_refund'):
- journal_type = 'sale_refund'
- elif type in ('in_refund'):
- journal_type = 'purchase_refund'
- else:
- journal_type = 'purchase'
+ journal_mapping = {
+ 'out_invoice': 'sale',
+ 'out_refund': 'sale_refund',
+ 'in_refund': 'purchase_refund',
+ 'in_invoice': 'purchase',
+ }
+ journal_type = journal_mapping[type]
journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)])
if journal_ids:
val['journal_id'] = journal_ids[0]
@@ -651,7 +657,12 @@ class account_invoice(osv.osv):
if r[1] == 'journal_id' and r[2] in journal_ids:
val['journal_id'] = r[2]
if not val.get('journal_id', False):
- raise osv.except_osv(_('Configuration Error!'), (_('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\Journals.') % (journal_type)))
+ journal_type_map = dict(obj_journal._columns['type'].selection)
+ journal_type_label = self.pool['ir.translation']._get_source(cr, uid, None, ('code','selection'),
+ context.get('lang'),
+ journal_type_map.get(journal_type))
+ raise osv.except_osv(_('Configuration Error!'),
+ _('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\Journals.') % ('"%s"' % journal_type_label))
dom = {'journal_id': [('id', 'in', journal_ids)]}
else:
journal_ids = obj_journal.search(cr, uid, [])
@@ -968,7 +979,7 @@ class account_invoice(osv.osv):
total, total_currency, iml = self.compute_invoice_totals(cr, uid, inv, company_currency, ref, iml, context=ctx)
acc_id = inv.account_id.id
- name = inv['name'] or '/'
+ name = inv['name'] or inv['supplier_invoice_number'] or '/'
totlines = False
if inv.payment_term:
totlines = payment_term_obj.compute(cr,
@@ -1167,12 +1178,12 @@ class account_invoice(osv.osv):
if not ids:
return []
types = {
- 'out_invoice': 'Invoice ',
- 'in_invoice': 'Sup. Invoice ',
- 'out_refund': 'Refund ',
- 'in_refund': 'Supplier Refund ',
+ 'out_invoice': _('Invoice'),
+ 'in_invoice': _('Supplier Invoice'),
+ 'out_refund': _('Refund'),
+ 'in_refund': _('Supplier Refund'),
}
- return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
+ return [(r['id'], '%s %s' % (r['number'] or types[r['type']], r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
if not args:
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index e604cc6d1a4..314e3423996 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -1066,12 +1066,12 @@ class account_move_line(osv.osv):
for line in self.browse(cr, uid, ids, context=context):
ctx = context.copy()
- if ('journal_id' not in ctx):
+ if not ctx.get('journal_id'):
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 not ctx.get('period_id'):
if line.move_id:
ctx['period_id'] = line.move_id.period_id.id
else:
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index e921e639642..758385d66cb 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -585,7 +585,10 @@
-
+
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 3dcc68e315e..6a58bc7f77e 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -61,7 +61,7 @@
partner.view.buttons
res.partner
-
+
2
-
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 6ce97b5c868..21ea2a85f7f 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -363,7 +363,7 @@
-
+
diff --git a/addons/account/report/account_journal_sale_purchase.rml b/addons/account/report/account_journal_sale_purchase.rml
index 236879669f9..3ee0b484c9a 100644
--- a/addons/account/report/account_journal_sale_purchase.rml
+++ b/addons/account/report/account_journal_sale_purchase.rml
@@ -239,7 +239,7 @@
[[ line.account_id.code ]]
[[ line.partner_id and strip_name(line.partner_id.name,15) ]]
[[ strip_name(line.name,25) ]]
- [[ line.tax_code_id and (line.tax_code_id.code + ':') ]]
+ [[ line.tax_code_id and line.tax_code_id.code and (line.tax_code_id.code + ':') ]]
[[ line.tax_amount and formatLang(line.tax_amount, currency_obj=company.currency_id) ]]
[[ formatLang(line.debit, currency_obj=company.currency_id) ]]
[[ formatLang(line.credit, currency_obj=company.currency_id) ]]
@@ -292,7 +292,7 @@
[[ line.account_id.code ]]
[[ line.partner_id and strip_name(line.partner_id.name,12) ]]
[[ strip_name(line.name,16) ]]
- [[ line.tax_code_id and (line.tax_code_id.code + ':') ]]
+ [[ line.tax_code_id and line.tax_code_id.code and (line.tax_code_id.code + ':') ]]
[[ line.tax_amount and formatLang(line.tax_amount, currency_obj=company.currency_id) ]]
[[ formatLang(line.debit, currency_obj=company.currency_id) ]]
[[ formatLang(line.credit, currency_obj=company.currency_id) ]]
diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py
index 6ceb833816b..928f0647084 100644
--- a/addons/account/wizard/account_fiscalyear_close.py
+++ b/addons/account/wizard/account_fiscalyear_close.py
@@ -38,7 +38,7 @@ class account_fiscalyear_close(osv.osv_memory):
'report_name': fields.char('Name of new entries',size=64, required=True, help="Give name of the new entries"),
}
_defaults = {
- 'report_name': _('End of Fiscal Year Entry'),
+ 'report_name': lambda self, cr, uid, context: _('End of Fiscal Year Entry'),
}
def data_save(self, cr, uid, ids, context=None):
diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py
index 1696874f0f5..563a6a3eb9a 100644
--- a/addons/account_analytic_default/account_analytic_default.py
+++ b/addons/account_analytic_default/account_analytic_default.py
@@ -72,8 +72,8 @@ 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_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
- res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
+ def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+ res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
if rec:
res_prod['value'].update({'account_analytic_id': rec.analytic_id.id})
diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml
index be46b9a6923..7fb4091b45f 100644
--- a/addons/account_analytic_plans/account_analytic_plans_view.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_view.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/addons/account_anglo_saxon/__openerp__.py b/addons/account_anglo_saxon/__openerp__.py
index 6482a110f1d..7ac4bdbd71e 100644
--- a/addons/account_anglo_saxon/__openerp__.py
+++ b/addons/account_anglo_saxon/__openerp__.py
@@ -43,7 +43,8 @@ account.""",
'depends': ['product', 'purchase'],
'category': 'Accounting & Finance',
'demo': [],
- 'data': ['product_view.xml',],
+ 'data': ['product_view.xml'],
+ 'test': ['test/anglo_saxon.yml'],
'auto_install': False,
'installable': True,
}
diff --git a/addons/account_anglo_saxon/docs/account_anglo_saxon.ods b/addons/account_anglo_saxon/docs/account_anglo_saxon.ods
new file mode 100644
index 00000000000..91b1d84786d
Binary files /dev/null and b/addons/account_anglo_saxon/docs/account_anglo_saxon.ods differ
diff --git a/addons/account_anglo_saxon/docs/account_anglo_saxon.pdf b/addons/account_anglo_saxon/docs/account_anglo_saxon.pdf
new file mode 100644
index 00000000000..f5250a0c11c
Binary files /dev/null and b/addons/account_anglo_saxon/docs/account_anglo_saxon.pdf differ
diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py
index 2b82257e1f0..f27d9b3ae72 100644
--- a/addons/account_anglo_saxon/invoice.py
+++ b/addons/account_anglo_saxon/invoice.py
@@ -136,9 +136,9 @@ class account_invoice_line(osv.osv):
res += diff_res
return res
- def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+ def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
fiscal_pool = self.pool.get('account.fiscal.position')
- res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
+ res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
if not product:
return res
if type in ('in_invoice','in_refund'):
diff --git a/addons/account_anglo_saxon/test/anglo_saxon.yml b/addons/account_anglo_saxon/test/anglo_saxon.yml
new file mode 100644
index 00000000000..9e46aa52b12
--- /dev/null
+++ b/addons/account_anglo_saxon/test/anglo_saxon.yml
@@ -0,0 +1,299 @@
+-
+ In order to test anglo_saxon Configure Different Accounts.
+-
+ !record {model: account.account, id: account_anglo_stock_valuation}:
+ code: X3000
+ name: Stock Valuation Account- (test)
+ parent_id: account.cas
+ type: other
+ user_type: account.data_account_type_asset
+-
+ Configure Stock Interim account (Received).
+-
+ !record {model: account.account, id: account_anglo_stock_input}:
+ code: X2800
+ name: Stock Interim account (Received)
+ parent_id: account.cos
+ type: other
+ user_type: account.data_account_type_expense
+-
+ Configure Stock Interim account (Delivered).
+-
+ !record {model: account.account, id: account_anglo_stock_output}:
+ code: X2801
+ name: Stock Interim account (Delivered)
+ parent_id: account.rev
+ type: other
+ user_type: account.data_account_type_income
+-
+ Configure Price difference creditor Account.
+-
+ !record {model: account.account, id: account_anglo_price_difference}:
+ code: X7095
+ name: Price difference creditor Account
+ parent_id: account.cos
+ type: other
+ user_type: account.data_account_type_expense
+-
+ Configure Cash Bank Account.
+-
+ !record {model: account.account, id: account_anglo_cash}:
+ code: X5000
+ name: Cash/Bank Account
+ parent_id: account.cash
+ type: other
+ user_type: account.data_account_type_asset
+-
+ Configure Creditor Account Payable.
+-
+ !record {model: account.account, id: account_anglo_payable}:
+ code: X440001
+ name: Creditor Account Payable
+ parent_id: account.a_pay
+ type: other
+ user_type: account.data_account_type_payable
+-
+ Configure Debtor Account Receivable.
+-
+ !record {model: account.account, id: account_anglo_receivable}:
+ code: X400001
+ name: Debtor Account Receivable
+ parent_id: account.a_recv
+ type: other
+ user_type: account.data_account_type_receivable
+-
+ Configure Cost of Good sale Account.
+-
+ !record {model: account.account, id: account_anglo_cogs}:
+ code: X7000
+ name: Cost of goods sale account
+ parent_id: account.o_expense
+ type: other
+ user_type: account.data_account_type_expense
+-
+ Configure Income Account.
+-
+ !record {model: account.account, id: account_anglo_income}:
+ code: X8000
+ name: Income Account
+ parent_id: account.o_income
+ type: other
+ user_type: account.data_account_type_income
+-
+ I configure the account receivable of supplier
+-
+ !record {model: res.partner, id: base.res_partner_3}:
+ property_account_payable: account_anglo_payable
+ property_account_receivable: account_anglo_receivable
+-
+ I configure the account receivable of Customer.
+-
+ !record {model: res.partner, id: base.res_partner_13}:
+ property_account_payable: account_anglo_payable
+ property_account_receivable: account_anglo_receivable
+-
+ I configure the product category with stock valuation account.
+-
+ !record {model: product.category, id: product.product_category_4}:
+ property_stock_valuation_account_id: account_anglo_stock_valuation
+-
+ I configure the product with required accounts, and cost method = standard
+-
+ !python {model: product.product}: |
+ self.write(cr, uid, [ref('product.product_product_3')], {'list_price': 20.00,'standard_price': 9,'categ_id': ref('product.product_category_4'),'valuation': 'real_time',
+ 'property_account_income': ref('account_anglo_income'),'property_account_expense': ref('account_anglo_cogs'),
+ 'property_account_creditor_price_difference': ref('account_anglo_price_difference'),'property_stock_account_input': ref('account_anglo_stock_input'),
+ 'property_stock_account_output': ref('account_anglo_stock_output'), 'cost_method': 'standard'})
+-
+ I create a draft Purchase Order.
+-
+ !record {model: purchase.order, id: purchase_order_001}:
+ partner_id: base.res_partner_3
+ location_id: stock.stock_location_3
+ pricelist_id: 1
+ order_line:
+ - product_id: product.product_product_3
+ product_qty: 1
+ price_unit: 10
+ date_planned: '2013-08-31'
+-
+ I confirm the purchase order.
+-
+ !workflow {model: purchase.order, ref: purchase_order_001, action: purchase_confirm}
+-
+ Reception is ready for process so now done the reception.
+-
+ !python {model: stock.partial.picking}: |
+ pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001")).picking_ids
+ partial_id = self.create(cr, uid, {},context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]})
+ self.do_partial(cr, uid, [partial_id])
+-
+ I check the Stock Interim account (Received) is credit successfully.
+-
+ !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not credited successfully.}:
+ - credit == 9
+-
+ I check the Stock valuation account is debit sucessfully.
+-
+ !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not debited successfully.}:
+ - debit == 9
+-
+ I Validate Invoice of Purchase Order.
+-
+ !python {model: purchase.order}: |
+ invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_001")).invoice_ids]
+ self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
+-
+ I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
+-
+ !assert {model: account.account, id : account_anglo_stock_input, string : Stock Interim account (Received) is not debited successfully.}:
+ - debit == 9
+-
+ I check the Price difference creditor Account is debited sucessfully when Invoice validated.
+-
+ !assert {model: account.account, id : account_anglo_price_difference, string : Price difference creditor Account is not debited successfully.}:
+ - debit == 1
+-
+ I check Payable(creditor) Account is Credited sucessfully when Invoice validated.
+-
+ !assert {model: account.account, id : account_anglo_payable, string : Payable(creditor) Account is not Credited successfully.}:
+ - credit == 10
+-
+ I open the Invoice.
+-
+ !python {model: purchase.order}: |
+ po = self.browse(cr, uid, ref("purchase_order_001"))
+ for invoice in po.invoice_ids:
+ self.pool.get('account.invoice').signal_invoice_open(cr, uid, [invoice.id])
+-
+ I pay the invoice.
+-
+ !python {model: purchase.order}: |
+ invoice_ids = self.browse(cr, uid, ref("purchase_order_001")).invoice_ids
+ order = self.browse(cr, uid, ref("purchase_order_001"))
+ journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', order.company_id.id)], limit=1)
+ for invoice in invoice_ids:
+ invoice.pay_and_reconcile(invoice.amount_total, ref('account_anglo_cash'), ref('account.period_8'), journal_ids[0], ref('account_anglo_cash'), ref('account.period_8'), journal_ids[0], name='test')
+-
+ I check Payable(Creditors) Account is Debited sucessfully after invoice paid.
+-
+ !assert {model: account.account, id : account_anglo_payable, string : Payable(Creditors) Account is not Debited successfully.}:
+ - debit == 10
+-
+ I check Bank/Cash account is credited sucessfully after invoice paid.
+-
+ !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not credited successfully.}:
+ - credit == 10
+-
+ I create an Outgoing Picking order
+-
+ !record {model: stock.picking, id: stock_picking_out001}:
+ partner_id: base.res_partner_13
+ invoice_state: 2binvoiced
+ move_lines:
+ - company_id: base.main_company
+ location_id: stock.stock_location_3
+ product_id: product.product_product_3
+ product_qty: 1.0
+ product_uom: product.product_uom_unit
+ location_dest_id: stock.stock_location_customers
+ move_type: direct
+ type: out
+-
+ I need to check the availability of the product, So I make my picking order for processing later.
+-
+ !python {model: stock.picking}: |
+ self.draft_force_assign(cr, uid, [ref("stock_picking_out001")], {"lang": "en_US", "search_default_available":
+ 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
+ "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
+ })
+-
+ I check the product availability, Product is available in the stock and ready to be sent.
+-
+ !python {model: stock.picking}: |
+ self.action_assign(cr, uid, [ref("stock_picking_out001")], {"lang": "en_US", "search_default_available":
+ 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
+ "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
+ })
+-
+ I process the delivery.
+-
+ !python {model: stock.partial.picking}: |
+ partial_id = self.create(cr, uid, {}, context={'active_model':'stock.picking','active_ids':[ref('stock_picking_out001')]})
+ self.do_partial(cr, uid, [partial_id])
+-
+ I check Stock Interim account (Delivery) is debited successfully.
+-
+ !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not debited successfully.}:
+ - debit == 9
+-
+ I check the Stock valuation account is credited sucessfully.
+-
+ !assert {model: account.account, id : account_anglo_stock_valuation, string : Stock valuation account is not credited successfully.}:
+ - credit == 9
+-
+ As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
+-
+ !python {model: stock.invoice.onshipping}: |
+ wiz_id = self.create(cr, uid, {'invoice_date': '2013-03-04', 'journal_id': ref('account.sales_journal')},
+ {'active_ids': [ref("stock_picking_out001")], "active_model": "stock.picking"})
+ self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US",
+ "search_default_available": 1, "tz": False, "active_model": "stock.picking",
+ "contact_display": "partner", "active_ids": [ref("stock_picking_out001")], "active_id": ref("stock_picking_out001")})
+-
+ I check that the customer invoice is created successfully.
+-
+ !python {model: account.invoice}: |
+ partner_id = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).partner_id.id
+ inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner_id)])
+ assert inv_ids, 'No Invoice is generated!'
+-
+ I open the Invoice.
+-
+ !python {model: stock.picking}: |
+ move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
+ account_invoice = self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
+ self.pool.get('account.invoice').signal_invoice_open(cr, uid, account_invoice)
+-
+ I check Income Account is Credited sucessfully when Invoice validated.
+-
+ !assert {model: account.account, id : account_anglo_income, string : Income Account is not Credited successfully.}:
+ - credit == 20
+-
+ I check Cost of goods sold account for debit.
+-
+ !assert {model: account.account, id : account_anglo_cogs, string : Cost of goods sale is not Debited successfully.}:
+ - debit == 9
+-
+ I check Stock Interim account (Delivery)
+-
+ !assert {model: account.account, id : account_anglo_stock_output, string : Stock Interim account (Delivery) is not credited successfully.}:
+ - credit == 9
+-
+ I check Receivable(Debtor) Account for debit.
+-
+ !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Debited successfully.}:
+ - debit == 20
+-
+ I pay the invoice.
+-
+ !python {model: account.invoice}: |
+ move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
+ account_invoice= self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
+ journal_ids = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')], limit=1)
+ pay = self.pay_and_reconcile(cr, uid, account_invoice,
+ 20.0, ref('account_anglo_cash'), ref('account.period_8'),
+ journal_ids[0], ref('account_anglo_cash'),
+ ref('account.period_8'), journal_ids[0],
+ name='Payment for test customer invoice')
+ assert (pay == True), "Incorrect Payment."
+-
+ I check Receivable(Debtor) Account for credit.
+-
+ !assert {model: account.account, id : account_anglo_receivable, string : Receivable(Debtors) Account is not Credited successfully.}:
+ - credit == 20
+-
+ I check Bank/Cash account is debited sucessfully after invoice paid.
+-
+ !assert {model: account.account, id : account_anglo_cash, string: Bank/Cash account is not successfully credited.}:
+ - debit == 20
diff --git a/addons/account_asset/account_asset_invoice_view.xml b/addons/account_asset/account_asset_invoice_view.xml
index eb6403b6f48..9a154d8ec70 100644
--- a/addons/account_asset/account_asset_invoice_view.xml
+++ b/addons/account_asset/account_asset_invoice_view.xml
@@ -13,6 +13,17 @@
+
+
+ account.invoice.supplier.form
+ account.invoice
+
+
+
+
+
+
+
diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml
index 9ad61d7c286..237406ff657 100644
--- a/addons/account_budget/account_budget_view.xml
+++ b/addons/account_budget/account_budget_view.xml
@@ -203,7 +203,9 @@
-
+
+ Click to create a new budget.
+
A budget is a forecast of your company's income and/or expenses
expected for a period in the future. A budget is defined on some
financial accounts and/or analytic accounts (that may represent
diff --git a/addons/account_followup/security/ir.model.access.csv b/addons/account_followup/security/ir.model.access.csv
index 8774015efc6..591cc347563 100644
--- a/addons/account_followup/security/ir.model.access.csv
+++ b/addons/account_followup/security/ir.model.access.csv
@@ -3,5 +3,5 @@ access_account_followup_followup_line,account_followup.followup.line,model_accou
access_account_followup_followup_line_manager,account_followup.followup.line.manager,model_account_followup_followup_line,account.group_account_manager,1,1,1,1
access_account_followup_followup_accountant,account_followup.followup user,model_account_followup_followup,account.group_account_invoice,1,0,0,0
access_account_followup_followup_manager,account_followup.followup.manager,model_account_followup_followup,account.group_account_manager,1,1,1,1
-access_account_followup_stat_invoice,account_followup.stat.invoice,model_account_followup_stat,account.group_account_invoice,1,1,1,1
-access_account_followup_stat_by_partner_manager,account_followup.stat.by.partner,model_account_followup_stat_by_partner,account.group_account_user,1,1,1,1
+access_account_followup_stat_invoice,account_followup.stat.invoice,model_account_followup_stat,account.group_account_invoice,1,1,0,0
+access_account_followup_stat_by_partner_manager,account_followup.stat.by.partner,model_account_followup_stat_by_partner,account.group_account_user,1,1,0,0
diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py
index 03e25dfbc45..de9c47ec005 100644
--- a/addons/account_payment/wizard/account_payment_order.py
+++ b/addons/account_payment/wizard/account_payment_order.py
@@ -88,6 +88,7 @@ class payment_order_create(osv.osv_memory):
'order_id': payment.id,
'partner_id': line.partner_id and line.partner_id.id or False,
'communication': line.ref or '/',
+ 'state': line.invoice and line.invoice.reference_type != 'none' and 'structured' or 'normal',
'date': date_to_pay,
'currency': (line.invoice and line.invoice.currency_id.id) or line.journal_id.currency.id or line.journal_id.company_id.currency_id.id,
}, context=context)
diff --git a/addons/account_voucher/i18n/ru.po b/addons/account_voucher/i18n/ru.po
index ef38a07e478..16e03d424ef 100644
--- a/addons/account_voucher/i18n/ru.po
+++ b/addons/account_voucher/i18n/ru.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
-"PO-Revision-Date: 2013-05-29 13:17+0000\n"
+"PO-Revision-Date: 2013-06-13 11:30+0000\n"
"Last-Translator: Chertykov Denis \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: 2013-05-30 05:45+0000\n"
-"X-Generator: Launchpad (build 16652)\n"
+"X-Launchpad-Export-Date: 2013-06-14 05:38+0000\n"
+"X-Generator: Launchpad (build 16667)\n"
#. module: account_voucher
#: field:account.bank.statement.line,voucher_id:0
@@ -27,7 +27,7 @@ msgid "account.config.settings"
msgstr "account.config.settings"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:369
+#: code:addons/account_voucher/account_voucher.py:417
#, python-format
msgid "Write-Off"
msgstr "Списание"
@@ -129,7 +129,7 @@ msgid "Voucher Statistics"
msgstr ""
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1547
+#: code:addons/account_voucher/account_voucher.py:1641
#, python-format
msgid ""
"You can not change the journal as you already reconciled some statement "
@@ -223,8 +223,8 @@ msgid "Journal Item"
msgstr "Элемент журнала"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:508
-#: code:addons/account_voucher/account_voucher.py:981
+#: code:addons/account_voucher/account_voucher.py:558
+#: code:addons/account_voucher/account_voucher.py:1073
#, python-format
msgid "Error!"
msgstr "Ошибка!"
@@ -251,7 +251,7 @@ msgid "Cancelled"
msgstr "Отменено"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1153
+#: code:addons/account_voucher/account_voucher.py:1249
#, python-format
msgid ""
"You have to configure account base code and account tax code on the '%s' tax!"
@@ -295,7 +295,7 @@ msgid "Tax"
msgstr "Налог"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:879
+#: code:addons/account_voucher/account_voucher.py:971
#, python-format
msgid "Invalid Action!"
msgstr "Неверное действие!"
@@ -348,7 +348,7 @@ msgid "Import Invoices"
msgstr "Импорт счетов"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1112
+#: code:addons/account_voucher/account_voucher.py:1208
#, python-format
msgid "Wrong voucher line"
msgstr ""
@@ -367,7 +367,7 @@ msgid "Receipt"
msgstr "Приход"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1018
+#: code:addons/account_voucher/account_voucher.py:1110
#, python-format
msgid ""
"You should configure the 'Gain Exchange Rate Account' in the accounting "
@@ -388,7 +388,7 @@ msgstr "Период"
#. module: account_voucher
#: view:account.voucher:0
-#: code:addons/account_voucher/account_voucher.py:211
+#: code:addons/account_voucher/account_voucher.py:231
#, python-format
msgid "Supplier"
msgstr "Поставщик"
@@ -409,7 +409,7 @@ msgid "Debit"
msgstr "Дебет"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1547
+#: code:addons/account_voucher/account_voucher.py:1641
#, python-format
msgid "Unable to change journal !"
msgstr "Невозможно изменить журнал!"
@@ -515,7 +515,7 @@ msgid "Pay Invoice"
msgstr "Оплата счета"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1153
+#: code:addons/account_voucher/account_voucher.py:1249
#, python-format
msgid "No Account Base Code and Account Tax Code!"
msgstr ""
@@ -569,15 +569,15 @@ msgid "To Review"
msgstr "Для проверки"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1025
-#: code:addons/account_voucher/account_voucher.py:1039
-#: code:addons/account_voucher/account_voucher.py:1194
+#: code:addons/account_voucher/account_voucher.py:1120
+#: code:addons/account_voucher/account_voucher.py:1134
+#: code:addons/account_voucher/account_voucher.py:1286
#, python-format
msgid "change"
msgstr "изменить"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1014
+#: code:addons/account_voucher/account_voucher.py:1106
#, python-format
msgid ""
"You should configure the 'Loss Exchange Rate Account' in the accounting "
@@ -631,6 +631,7 @@ msgstr "Месяц"
#. module: account_voucher
#: field:account.voucher,currency_id:0
#: field:account.voucher.line,currency_id:0
+#: model:ir.model,name:account_voucher.model_res_currency
#: field:sale.receipt.report,currency_id:0
msgid "Currency"
msgstr "Валюта"
@@ -674,7 +675,7 @@ msgid "Reconcile Payment Balance"
msgstr "Сверка платежного баланса"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:975
+#: code:addons/account_voucher/account_voucher.py:1067
#, python-format
msgid "Configuration Error !"
msgstr "Ошибка конфигурации !"
@@ -739,7 +740,7 @@ msgid "October"
msgstr "Октябрь"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:976
+#: code:addons/account_voucher/account_voucher.py:1068
#, python-format
msgid "Please activate the sequence of selected journal !"
msgstr "Пожалуйста, включите нумерацию выбранного журнала!"
@@ -819,7 +820,7 @@ msgid "Previous Payments ?"
msgstr "Предыдущие платежи ?"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1112
+#: code:addons/account_voucher/account_voucher.py:1208
#, python-format
msgid "The invoice you are willing to pay is not valid anymore."
msgstr "Счет, который вы готовы платить, уже не актуален ."
@@ -851,7 +852,7 @@ msgid "Active"
msgstr "Активно"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:982
+#: code:addons/account_voucher/account_voucher.py:1074
#, python-format
msgid "Please define a sequence on the journal."
msgstr "Пожалуйста, определите нумерацию журнала."
@@ -861,7 +862,7 @@ msgstr "Пожалуйста, определите нумерацию журна
#: model:ir.actions.act_window,name:account_voucher.action_vendor_receipt
#: model:ir.ui.menu,name:account_voucher.menu_action_vendor_receipt
msgid "Customer Payments"
-msgstr "Платежи клиентов"
+msgstr "Платежи заказчиков"
#. module: account_voucher
#: model:ir.actions.act_window,name:account_voucher.action_sale_receipt_report_all
@@ -979,7 +980,7 @@ msgid "Journal Items"
msgstr "Элементы журнала"
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:508
+#: code:addons/account_voucher/account_voucher.py:558
#, python-format
msgid "Please define default credit/debit accounts on the journal \"%s\"."
msgstr ""
@@ -1188,7 +1189,7 @@ msgid ""
msgstr ""
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:879
+#: code:addons/account_voucher/account_voucher.py:971
#, python-format
msgid "Cannot delete voucher(s) which are already opened or paid."
msgstr ""
@@ -1251,8 +1252,8 @@ msgid "Status changed "
msgstr ""
#. module: account_voucher
-#: code:addons/account_voucher/account_voucher.py:1014
-#: code:addons/account_voucher/account_voucher.py:1018
+#: code:addons/account_voucher/account_voucher.py:1106
+#: code:addons/account_voucher/account_voucher.py:1110
#, python-format
msgid "Insufficient Configuration!"
msgstr ""
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 3f7ef2f3f0c..62eb2e812cc 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -102,7 +102,10 @@ class OAuthController(oeweb.Controller):
registry = RegistryManager.get(dbname)
with registry.cursor() as cr:
IMD = registry['ir.model.data']
- model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
+ try:
+ model, provider_id = IMD.get_object_reference(cr, SUPERUSER_ID, 'auth_oauth', 'provider_openerp')
+ except ValueError:
+ return set_cookie_and_redirect(req, '/?db=%s' % dbname)
assert model == 'auth.oauth.provider'
state = {
diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py
index aa476002abc..1051a7a894c 100644
--- a/addons/base_calendar/crm_meeting.py
+++ b/addons/base_calendar/crm_meeting.py
@@ -60,7 +60,7 @@ class crm_meeting(base_state, osv.Model):
'categ_ids': fields.many2many('crm.meeting.type', 'meeting_category_rel',
'event_id', 'type_id', 'Tags'),
'attendee_ids': fields.many2many('calendar.attendee', 'meeting_attendee_rel',\
- 'event_id', 'attendee_id', 'Attendees', states={'done': [('readonly', True)]}),
+ 'event_id', 'attendee_id', 'Invited People', states={'done': [('readonly', True)]}),
}
_defaults = {
'state': 'open',
diff --git a/addons/base_import/static/csv/o2m_customers_contacts.csv b/addons/base_import/static/csv/o2m_customers_contacts.csv
new file mode 100644
index 00000000000..9a2411b2bee
--- /dev/null
+++ b/addons/base_import/static/csv/o2m_customers_contacts.csv
@@ -0,0 +1,9 @@
+Name,Is a company,Related company,Address type,Customer,Supplier,Street,ZIP,City,State,Country
+Aurora Shelves,1,,,1,0,25 Pacific Road,95101,San José,CA,United States
+Roger Martins,0,Aurora Shelves,Invoice,1,0,27 Pacific Road,95102,San José,CA,United States
+House Sales Direct,1,,,1,0,104 Saint Mary Avenue,94059,Redwood,CA,United States
+Yvan Holiday,0,House Sales Direct,Default,1,0,104 Saint Mary Avenue,94060,Redwood,CA,United States
+Jack Unsworth,0,House Sales Direct,Invoice,1,0,227 Jackson Road,94061,Redwood,CA,United States
+Michael Mason,0,,,1,0,16 5th Avenue,94104,San Francisco,CA,United States
+International Wood,1,,,1,0,748 White House Boulevard,20004,Washington,DC,United States
+Sharon Pecker,0,International Wood,Invoice,1,0,755 White House Boulevard,20005,Washington,DC,United States
diff --git a/addons/base_import/static/csv/o2m_suppliers_contacts.csv b/addons/base_import/static/csv/o2m_suppliers_contacts.csv
deleted file mode 100644
index 6c7be9037b8..00000000000
--- a/addons/base_import/static/csv/o2m_suppliers_contacts.csv
+++ /dev/null
@@ -1,8 +0,0 @@
-Name,Address type,Street,City,Country,Tags,Supplier,Customer,Is a company,Companies that refers to partner / Parent company
-Wood y Wood Pecker,,"Snow Street, 25",Kainuu,Finland,Supplier,1,0,1,
-Roger Pecker,Default,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
-Sharon Pecker,Delivery,"Snow Street, 28",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
-Thomas Pecker,Contact,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
-Vicking Direct,,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,1,
-Yvan Holiday,Invoice,"Atonium Street, 45b",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
-Jack Unsworth,Contact,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
diff --git a/addons/base_import/static/src/xml/import.xml b/addons/base_import/static/src/xml/import.xml
index c8b2b2c63dd..97bf3e66f7a 100644
--- a/addons/base_import/static/src/xml/import.xml
+++ b/addons/base_import/static/src/xml/import.xml
@@ -229,8 +229,8 @@
orders with their respective purchase order lines:
Purchase orders with their respective purchase order lines
The following CSV file shows how to import
- suppliers and their respective contacts
- Suppliers and their respective contacts
+ customers and their respective contacts
+ Customers and their respective contacts
diff --git a/addons/base_report_designer/base_report_designer_installer.xml b/addons/base_report_designer/base_report_designer_installer.xml
index 99898f5a703..61b7fbc4c1d 100644
--- a/addons/base_report_designer/base_report_designer_installer.xml
+++ b/addons/base_report_designer/base_report_designer_installer.xml
@@ -14,9 +14,13 @@
-
+
+
+
+
+
+
-
diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py
index 5d6f8ca6dbc..e0176bfec62 100644
--- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py
+++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/rpc.py
@@ -61,8 +61,8 @@ class RPCSession(object):
protocol = m.group(1)
if not m:
return -1
- if protocol == 'http://' or protocol == 'http://':
- self.gateway = XMLRPCGateway(host, port, 'http')
+ if protocol == 'http://' or protocol == 'https://':
+ self.gateway = XMLRPCGateway(host, port, protocol[:-3])
elif protocol == 'socket://':
self.gateway = NETRPCGateway(host, port)
diff --git a/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip
index 7d03f45dbb4..238f9d19671 100644
Binary files a/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip and b/addons/base_report_designer/static/base-report-designer-plugin/openerp_report_designer.zip differ
diff --git a/addons/board/__openerp__.py b/addons/board/__openerp__.py
index e699e091176..87771b2f518 100644
--- a/addons/board/__openerp__.py
+++ b/addons/board/__openerp__.py
@@ -31,7 +31,7 @@ Lets the user create a custom dashboard.
Allows users to create custom dashboard.
""",
'author': 'OpenERP SA',
- 'depends': ['base'],
+ 'depends': ['base', 'web'],
'data': [
'security/ir.model.access.csv',
'board_view.xml',
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index 3489b686e1b..4f50d2281fe 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -344,7 +344,7 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
},
load_data:function(){
var board = new instance.web.Model('board.board');
- return board.call('list');
+ return board.call('list', [board.context()]);
},
_x:function() {
if (!instance.webclient) { return $.Deferred().reject(); }
diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml
index dd6c50dbaba..8b941a395dd 100644
--- a/addons/crm/res_partner_view.xml
+++ b/addons/crm/res_partner_view.xml
@@ -2,19 +2,6 @@
-
-
- view.res.partner.form.crm.inherited1
- res.partner
-
-
-
-
-
-
-
-
-
Meetings
@@ -91,24 +78,31 @@
-
-
- res.partner.view.buttons
+
+
+ view.res.partner.form.crm.inherited1
res.partner
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py
index 61257265f1b..eaec2e4fc2b 100644
--- a/addons/crm_claim/__openerp__.py
+++ b/addons/crm_claim/__openerp__.py
@@ -42,14 +42,20 @@ automatically new claims based on incoming emails.
'security/ir.model.access.csv',
'report/crm_claim_report_view.xml',
'crm_claim_data.xml',
+ 'res_partner_view.xml',
],
'demo': ['crm_claim_demo.xml'],
- 'test': ['test/process/claim.yml',
- 'test/ui/claim_demo.yml'
+ 'test': [
+ 'test/process/claim.yml',
+ 'test/ui/claim_demo.yml'
],
'installable': True,
'auto_install': False,
- 'images': ['images/claim_categories.jpeg','images/claim_stages.jpeg','images/claims.jpeg'],
+ 'images': [
+ 'images/claim_categories.jpeg',
+ 'images/claim_stages.jpeg',
+ 'images/claims.jpeg'
+ ],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_claim/crm_claim_menu.xml b/addons/crm_claim/crm_claim_menu.xml
index 5abfcabbc71..59ec2acac2f 100644
--- a/addons/crm_claim/crm_claim_menu.xml
+++ b/addons/crm_claim/crm_claim_menu.xml
@@ -15,7 +15,11 @@
{"search_default_user_id":uid, "stage_type":'claim'}
- Record and track your customers' claims. Claims may be linked to a sales order or a lot. You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on). Claims may automatically be linked to an email address using the mail gateway module.
+
+
+ Record and track your customers' claims. Claims may be linked to a sales order or a lot.You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).Claims may automatically be linked to an email address using the mail gateway module.
+
+
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index e295bfdd250..0d2d8b391e7 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -216,35 +216,5 @@
-
-
- res.partner.claim.info.form
- res.partner
-
- 20
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_claim/res_partner_view.xml b/addons/crm_claim/res_partner_view.xml
new file mode 100644
index 00000000000..4a5db879311
--- /dev/null
+++ b/addons/crm_claim/res_partner_view.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ res.partner.claim.info.form
+ res.partner
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/document_page/document_page_view.xml b/addons/document_page/document_page_view.xml
index 4d0b5596e75..9d02b47d265 100644
--- a/addons/document_page/document_page_view.xml
+++ b/addons/document_page/document_page_view.xml
@@ -88,7 +88,11 @@
tree,form
- Create web pages
+
+
+ Click to create a new web page.
+
+
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index 2a7990e301b..2e3405ed079 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -24,8 +24,8 @@ import base64
import logging
import openerp
+from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
-from openerp.osv import fields
from openerp import tools
from openerp.tools.translate import _
from urllib import urlencode, quote as quote
@@ -191,7 +191,6 @@ class email_template(osv.osv):
}
def create_action(self, cr, uid, ids, context=None):
- vals = {}
action_obj = self.pool.get('ir.actions.act_window')
data_obj = self.pool.get('ir.model.data')
for template in self.browse(cr, uid, ids, context=context):
@@ -199,7 +198,7 @@ class email_template(osv.osv):
model_data_id = data_obj._get_id(cr, uid, 'mail', 'email_compose_message_wizard_form')
res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
button_name = _('Send Mail (%s)') % template.name
- vals['ref_ir_act_window'] = action_obj.create(cr, uid, {
+ act_id = action_obj.create(cr, SUPERUSER_ID, {
'name': button_name,
'type': 'ir.actions.act_window',
'res_model': 'mail.compose.message',
@@ -211,27 +210,29 @@ class email_template(osv.osv):
'target': 'new',
'auto_refresh':1
}, context)
- vals['ref_ir_value'] = self.pool.get('ir.values').create(cr, uid, {
+ ir_values_id = self.pool.get('ir.values').create(cr, SUPERUSER_ID, {
'name': button_name,
'model': src_obj,
'key2': 'client_action_multi',
- 'value': "ir.actions.act_window," + str(vals['ref_ir_act_window']),
+ 'value': "ir.actions.act_window,%s" % act_id,
'object': True,
}, context)
- self.write(cr, uid, ids, {
- 'ref_ir_act_window': vals.get('ref_ir_act_window',False),
- 'ref_ir_value': vals.get('ref_ir_value',False),
- }, context)
+
+ template.write({
+ 'ref_ir_act_window': act_id,
+ 'ref_ir_value': ir_values_id,
+ })
+
return True
def unlink_action(self, cr, uid, ids, context=None):
for template in self.browse(cr, uid, ids, context=context):
try:
if template.ref_ir_act_window:
- self.pool.get('ir.actions.act_window').unlink(cr, uid, template.ref_ir_act_window.id, context)
+ self.pool.get('ir.actions.act_window').unlink(cr, SUPERUSER_ID, template.ref_ir_act_window.id, context)
if template.ref_ir_value:
ir_values_obj = self.pool.get('ir.values')
- ir_values_obj.unlink(cr, uid, template.ref_ir_value.id, context)
+ ir_values_obj.unlink(cr, SUPERUSER_ID, template.ref_ir_value.id, context)
except Exception:
raise osv.except_osv(_("Warning"), _("Deletion of the action record failed."))
return True
diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py
index 7f44828ce15..746c2cc55f6 100644
--- a/addons/email_template/wizard/mail_compose_message.py
+++ b/addons/email_template/wizard/mail_compose_message.py
@@ -54,18 +54,22 @@ class mail_compose_message(osv.TransientModel):
Indeed, basic mail.compose.message wizard duplicates attachments in mass
mailing mode. But in 'single post' mode, attachments of an email template
also have to be duplicated to avoid changing their ownership. """
+ if context is None:
+ context = {}
+ wizard_context = dict(context)
for wizard in self.browse(cr, uid, ids, context=context):
+ if wizard.template_id and not wizard.template_id.user_signature:
+ wizard_context['mail_notify_user_signature'] = False # template user_signature is added when generating body_html
if not wizard.attachment_ids or wizard.composition_mode == 'mass_mail' or not wizard.template_id:
continue
- template = self.pool.get('email.template').browse(cr, uid, wizard.template_id.id, context=context)
new_attachment_ids = []
for attachment in wizard.attachment_ids:
- if attachment in template.attachment_ids:
+ if attachment in wizard.template_id.attachment_ids:
new_attachment_ids.append(self.pool.get('ir.attachment').copy(cr, uid, attachment.id, {'res_model': 'mail.compose.message', 'res_id': wizard.id}, context=context))
else:
new_attachment_ids.append(attachment.id)
self.write(cr, uid, wizard.id, {'attachment_ids': [(6, 0, new_attachment_ids)]}, context=context)
- return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
+ return super(mail_compose_message, self).send_mail(cr, uid, ids, context=wizard_context)
def onchange_template_id(self, cr, uid, ids, template_id, composition_mode, model, res_id, context=None):
""" - mass_mailing: we cannot render, so return the template values
diff --git a/addons/event/res_partner.py b/addons/event/res_partner.py
index fc4afa56e69..b51e1fbb9d3 100644
--- a/addons/event/res_partner.py
+++ b/addons/event/res_partner.py
@@ -21,15 +21,13 @@
from openerp.osv import fields, osv
+
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'speaker': fields.boolean('Speaker', help="Check this box if this contact is a speaker."),
- 'event_ids': fields.one2many('event.event','main_speaker_id', readonly=True),
- 'event_registration_ids': fields.one2many('event.registration','partner_id', readonly=True),
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml
index c3e8073a7ae..7e97f80e30d 100644
--- a/addons/event/res_partner_view.xml
+++ b/addons/event/res_partner_view.xml
@@ -2,9 +2,8 @@
-
-
-
+
+
res.partner.event.info.inherit
res.partner
@@ -12,34 +11,8 @@
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml
index 4d0e6298129..a8f6a321daf 100644
--- a/addons/fleet/fleet_view.xml
+++ b/addons/fleet/fleet_view.xml
@@ -591,6 +591,9 @@
tree,graph
{"search_default_groupby_vehicle" : True}
+
+ Click to create a new odometer log.
+
Here you can add various odometer entries for all vehicles.
You can also show odometer value for a particular vehicle using
diff --git a/addons/hr/__init__.py b/addons/hr/__init__.py
index 02ac7f16fd9..fbd01761f39 100644
--- a/addons/hr/__init__.py
+++ b/addons/hr/__init__.py
@@ -23,5 +23,6 @@ import hr_department
import hr
import res_config
+import res_users
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py
index b4b8e982845..b074a80aa88 100644
--- a/addons/hr/__openerp__.py
+++ b/addons/hr/__openerp__.py
@@ -59,6 +59,8 @@ You can manage:
'hr_installer.xml',
'hr_data.xml',
'res_config_view.xml',
+ 'mail_hr_view.xml',
+ 'res_users_view.xml',
],
'demo': ['hr_demo.xml'],
'test': [
@@ -69,5 +71,7 @@ You can manage:
'application': True,
'auto_install': False,
'css': [ 'static/src/css/hr.css' ],
+ 'js': [ 'static/src/js/suggestions.js' ],
+ 'qweb': [ 'static/src/xml/suggestions.xml' ],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index 7f704e42e5e..4849d3a7d8b 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -25,9 +25,11 @@ from openerp.modules.module import get_module_resource
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
+from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
+
class hr_employee_category(osv.osv):
def name_get(self, cr, uid, ids, context=None):
@@ -150,6 +152,7 @@ class hr_job(osv.osv):
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
+ _order = 'name_related'
_inherits = {'resource.resource': "resource_id"}
_inherit = ['mail.thread']
@@ -158,10 +161,10 @@ class hr_employee(osv.osv):
for obj in self.browse(cr, uid, ids, context=context):
result[obj.id] = tools.image_get_resized_images(obj.image)
return result
-
+
def _set_image(self, cr, uid, id, name, value, args, context=None):
return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context)
-
+
_columns = {
#we need a related field in order to be able to sort the employee by name
'name_related': fields.related('resource_id', 'name', type='char', string='Name', readonly=True, store=True),
@@ -171,12 +174,12 @@ class hr_employee(osv.osv):
'sinid': fields.char('SIN No', size=32, help="Social Insurance Number"),
'identification_id': fields.char('Identification No', size=32),
'otherid': fields.char('Other Id', size=64),
- 'gender': fields.selection([('male', 'Male'),('female', 'Female')], 'Gender'),
+ 'gender': fields.selection([('male', 'Male'), ('female', 'Female')], 'Gender'),
'marital': fields.selection([('single', 'Single'), ('married', 'Married'), ('widower', 'Widower'), ('divorced', 'Divorced')], 'Marital Status'),
- 'department_id':fields.many2one('hr.department', 'Department'),
+ 'department_id': fields.many2one('hr.department', 'Department'),
'address_id': fields.many2one('res.partner', 'Working Address'),
'address_home_id': fields.many2one('res.partner', 'Home Address'),
- 'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account Number', domain="[('partner_id','=',address_home_id)]", help="Employee bank salary account"),
+ 'bank_account_id': fields.many2one('res.partner.bank', 'Bank Account Number', domain="[('partner_id','=',address_home_id)]", help="Employee bank salary account"),
'work_phone': fields.char('Work Phone', size=32, readonly=False),
'mobile_phone': fields.char('Work Mobile', size=32, readonly=False),
'work_email': fields.char('Work Email', size=240),
@@ -207,25 +210,42 @@ class hr_employee(osv.osv):
help="Small-sized photo of the employee. It is automatically "\
"resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
- 'passport_id':fields.char('Passport No', size=64),
+ 'passport_id': fields.char('Passport No', size=64),
'color': fields.integer('Color Index'),
'city': fields.related('address_id', 'city', type='char', string='City'),
'login': fields.related('user_id', 'login', type='char', string='Login', readonly=1),
'last_login': fields.related('user_id', 'date', type='datetime', string='Latest Connection', readonly=1),
}
- _order='name_related'
+ def _get_default_image(self, cr, uid, context=None):
+ image_path = get_module_resource('hr', 'static/src/img', 'default_image.png')
+ return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
+
+ defaults = {
+ 'active': 1,
+ 'image': _get_default_image,
+ 'color': 0,
+ }
def create(self, cr, uid, data, context=None):
- employee_id = super(hr_employee, self).create(cr, uid, data, context=context)
- try:
- (model, mail_group_id) = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'mail', 'group_all_employees')
- employee = self.browse(cr, uid, employee_id, context=context)
- self.pool.get('mail.group').message_post(cr, uid, [mail_group_id],
- body=_('Welcome to %s! Please help him/her take the first steps with OpenERP!') % (employee.name),
- subtype='mail.mt_comment', context=context)
- except:
- pass # group deleted: do not push a message
+ if context is None:
+ context = {}
+ create_ctx = dict(context, mail_create_nolog=True)
+ employee_id = super(hr_employee, self).create(cr, uid, data, context=create_ctx)
+ employee = self.browse(cr, uid, employee_id, context=context)
+ if employee.user_id:
+ # send a copy to every user of the company
+ company_id = employee.user_id.partner_id.company_id.id
+ partner_ids = self.pool.get('res.partner').search(cr, uid, [
+ ('company_id', '=', company_id),
+ ('user_ids', '!=', False)], context=context)
+ else:
+ partner_ids = []
+ self.message_post(cr, uid, [employee_id],
+ body=_('Welcome to %s! Please help him/her take the first steps with OpenERP!') % (employee.name),
+ partner_ids=partner_ids,
+ subtype='mail.mt_comment', context=context
+ )
return employee_id
def unlink(self, cr, uid, ids, context=None):
@@ -246,7 +266,7 @@ class hr_employee(osv.osv):
company_id = self.pool.get('res.company').browse(cr, uid, company, context=context)
address = self.pool.get('res.partner').address_get(cr, uid, [company_id.partner_id.id], ['default'])
address_id = address and address['default'] or False
- return {'value': {'address_id' : address_id}}
+ return {'value': {'address_id': address_id}}
def onchange_department_id(self, cr, uid, ids, department_id, context=None):
value = {'parent_id': False}
@@ -259,17 +279,36 @@ class hr_employee(osv.osv):
work_email = False
if user_id:
work_email = self.pool.get('res.users').browse(cr, uid, user_id, context=context).email
- return {'value': {'work_email' : work_email}}
+ return {'value': {'work_email': work_email}}
- def _get_default_image(self, cr, uid, context=None):
- image_path = get_module_resource('hr', 'static/src/img', 'default_image.png')
- return tools.image_resize_image_big(open(image_path, 'rb').read().encode('base64'))
+ def action_follow(self, cr, uid, ids, context=None):
+ """ Wrapper because message_subscribe_users take a user_ids=None
+ that receive the context without the wrapper. """
+ return self.message_subscribe_users(cr, uid, ids, context=context)
- _defaults = {
- 'active': 1,
- 'image': _get_default_image,
- 'color': 0,
- }
+ def action_unfollow(self, cr, uid, ids, context=None):
+ """ Wrapper because message_unsubscribe_users take a user_ids=None
+ that receive the context without the wrapper. """
+ return self.message_unsubscribe_users(cr, uid, ids, context=context)
+
+ def get_suggested_thread(self, cr, uid, removed_suggested_threads=None, context=None):
+ """Show the suggestion of employees if display_employees_suggestions if the
+ user perference allows it. """
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ if not user.display_employees_suggestions:
+ return []
+ else:
+ return super(hr_employee, self).get_suggested_thread(cr, uid, removed_suggested_threads, context)
+
+ def _message_get_auto_subscribe_fields(self, cr, uid, updated_fields, auto_follow_fields=['user_id'], context=None):
+ """ Overwrite of the original method to always follow user_id field,
+ even when not track_visibility so that a user will follow it's employee
+ """
+ user_field_lst = []
+ for name, column_info in self._all_columns.items():
+ if name in auto_follow_fields and name in updated_fields and column_info.column._obj == 'res.users':
+ user_field_lst.append(name)
+ return user_field_lst
def _check_recursion(self, cr, uid, ids, context=None):
level = 100
@@ -285,6 +324,22 @@ class hr_employee(osv.osv):
(_check_recursion, 'Error! You cannot create recursive hierarchy of Employee(s).', ['parent_id']),
]
+ # ---------------------------------------------------
+ # Mail gateway
+ # ---------------------------------------------------
+
+ def check_mail_message_access(self, cr, uid, mids, operation, model_obj=None, context=None):
+ """ mail.message document permission rule: can post a new message if can read
+ because of portal document. """
+ if not model_obj:
+ model_obj = self
+ employee_ids = model_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
+ if employee_ids and operation == 'create':
+ model_obj.check_access_rights(cr, uid, 'read')
+ model_obj.check_access_rule(cr, uid, mids, 'read', context=context)
+ else:
+ return super(hr_employee, self).check_mail_message_access(cr, uid, mids, operation, model_obj=model_obj, context=context)
+
class hr_department(osv.osv):
_description = "Department"
diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml
index ccd11bc0dc2..19a6d70839f 100644
--- a/addons/hr/hr_view.xml
+++ b/addons/hr/hr_view.xml
@@ -27,6 +27,10 @@
+
+
+
+