diff --git a/addons/account/account.py b/addons/account/account.py index 278f41a8df8..0b70ea1a826 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -111,7 +111,7 @@ class account_payment_term_line(osv.osv): 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), - 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True), + 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True, ondelete='cascade'), } _defaults = { 'value': 'balance', @@ -1377,7 +1377,7 @@ class account_move(osv.osv): balance = 0.0 for line in line_ids: if line[2]: - balance += (line[2]['debit'] or 0.00)- (line[2]['credit'] or 0.00) + balance += (line[2].get('debit',0.00)- (line[2].get('credit',0.00))) return {'value': {'balance': balance}} def write(self, cr, uid, ids, vals, context=None): diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 8df291a98d1..095d461ff3b 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -430,7 +430,7 @@ class account_bank_statement(osv.osv): 'name': st_number, 'balance_end_real': st.balance_end }, context=context) - self.message_append_note(cr, uid, [st.id], body=_('Statement %s is confirmed, journal items are created.') % (st_number,), context=context) + self.message_post(cr, uid, [st.id], body=_('Statement %s confirmed, journal items were created.') % (st_number,), context=context) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) def button_cancel(self, cr, uid, ids, context=None): diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7bc9ceaaf61..15027b7a8f6 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1045,7 +1045,7 @@ class account_invoice(osv.osv): if obj_inv.type in ('out_invoice', 'out_refund'): ctx = self.get_log_context(cr, uid, context=ctx) message = _("Invoice '%s' is validated.") % name - self.message_append_note(cr, uid, [inv_id], body=message, context=context) + self.message_post(cr, uid, [inv_id], body=message, context=context) return True def action_cancel(self, cr, uid, ids, *args): @@ -1275,7 +1275,7 @@ class account_invoice(osv.osv): # TODO: use currency's formatting function msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining).") % \ (name, pay_amount, code, invoice.amount_total, code, total, code) - self.message_append_note(cr, uid, [inv_id], body=msg, context=context) + self.message_post(cr, uid, [inv_id], body=msg, context=context) self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) # Update the stored value (fields.function), so we write to trigger recompute @@ -1288,24 +1288,25 @@ class account_invoice(osv.osv): def _get_document_type(self, type): type_dict = { - 'out_invoice': 'Customer invoice', - 'in_invoice': 'Supplier invoice', - 'out_refund': 'Customer Refund', - 'in_refund': 'Supplier Refund', + # Translation markers will have no effect at runtime, only used to properly flag export + 'out_invoice': _('Customer invoice'), + 'in_invoice': _('Supplier invoice'), + 'out_refund': _('Customer Refund'), + 'in_refund': _('Supplier Refund'), } return type_dict.get(type, 'Invoice') def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), context=context) + self.message_post(cr, uid, [obj.id], body=_("%s created.") % (_(self._get_document_type(obj.type))), context=context) def confirm_paid_send_note(self, cr, uid, ids, context=None): - for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), context=context) + for obj in self.browse(cr, uid, ids, context=context): + self.message_post(cr, uid, [obj.id], body=_("%s paid.") % (_(self._get_document_type(obj.type))), context=context) def invoice_cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("%s cancelled.") % (self._get_document_type(obj.type)), context=context) + self.message_post(cr, uid, [obj.id], body=_("%s cancelled.") % (_(self._get_document_type(obj.type))), context=context) account_invoice() @@ -1361,10 +1362,16 @@ class account_invoice_line(osv.osv): 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True) } + + def _default_account_id(self, cr, uid, ids, context=None): + prop = self.pool.get('ir.property').get(cr, uid, 'property_account_income_categ', 'product.category', context=context) + return prop and prop.id or False + _defaults = { 'quantity': 1, 'discount': 0.0, 'price_unit': _price_unit_default, + 'account_id': _default_account_id, } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): @@ -1473,10 +1480,11 @@ class account_invoice_line(osv.osv): prod = self.pool.get('product.product').browse(cr, uid, product, context=context) prod_uom = self.pool.get('product.uom').browse(cr, uid, uom, context=context) if prod.uom_id.category_id.id != prod_uom.category_id.id: - warning = { + warning = { 'title': _('Warning!'), 'message': _('The selected unit of measure is not compatible with the unit of measure of the product.') - } + } + res['value'].update({'uos_id': prod.uom_id.id}) return {'value': res['value'], 'warning': warning} return res diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 143c5514141..610485ec3a0 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -191,17 +191,23 @@ - - - - + + + + + + + + - - - - @@ -342,17 +348,22 @@ - - + + + + diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index 630c551c5ca..563c3f5fc6c 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -29,7 +29,6 @@
- diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index b7bc34a3e35..94b3d2d4085 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -383,7 +383,7 @@ cash - + diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml index 0eec6d27785..53fa03a6902 100644 --- a/addons/account/edi/invoice_action_data.xml +++ b/addons/account/edi/invoice_action_data.xml @@ -123,64 +123,6 @@ ]]> - '%(object.user_id.email) or ''} - -You can view the invoice document, download it and pay online using the following link: - ${ctx.get('edi_web_url_view') or 'n/a'} - -% if object.company_id.paypal_account and object.type in ('out_invoice', 'in_refund'): -<% -comp_name = quote(object.company_id.name) -inv_number = quote(object.number) -paypal_account = quote(object.company_id.paypal_account) -inv_amount = quote(str(object.amount_total)) -cur_name = quote(object.currency_id.name) -paypal_url = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=%s&item_name=%s%%20Invoice%%20%s"\ - "&invoice=%s&amount=%s¤cy_code=%s&button_subtype=services&no_note=1&bn=OpenERP_Invoice_PayNow_%s" % \ - (paypal_account,comp_name,inv_number,inv_number,inv_amount,cur_name,cur_name) -%> -It is also possible to directly pay with Paypal: - ${paypal_url} -% endif - -If you have any question, do not hesitate to contact us. - - -Thank you for choosing ${object.company_id.name}! - - --- -${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''} -${object.company_id.name} -% if object.company_id.street: -${object.company_id.street or ''} -% endif -% if object.company_id.street2: -${object.company_id.street2} -% endif -% if object.company_id.city or object.company_id.zip: -${object.company_id.zip or ''} ${object.company_id.city or ''} -% endif -% if object.company_id.country_id: -${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''} -% endif -% if object.company_id.phone: -Phone: ${object.company_id.phone} -% endif -% if object.company_id.website: -${object.company_id.website or ''} -% endif - ]]> diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 174002a8d8d..0d5439719e2 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -9538,7 +9538,7 @@ msgid "Refund" msgstr "" #. module: account -#: model:email.template,body_text:account.email_template_edi_invoice +#: model:email.template,body:account.email_template_edi_invoice msgid "\n" "Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},\n" "\n" diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 02da9a6ab1f..9acc09e9026 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -30,9 +30,11 @@ class account_common_report(osv.osv_memory): _description = "Account Common Report" def onchange_chart_id(self, cr, uid, ids, chart_account_id=False, context=None): + res = {} if chart_account_id: company_id = self.pool.get('account.account').browse(cr, uid, chart_account_id, context=context).company_id.id - return {'value': {'company_id': company_id}} + res['value'] = {'company_id': company_id} + return res _columns = { 'chart_account_id': fields.many2one('account.account', 'Chart of Account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]), diff --git a/addons/account/wizard/pos_box.py b/addons/account/wizard/pos_box.py index b4254b5ba84..b5d1cc37776 100644 --- a/addons/account/wizard/pos_box.py +++ b/addons/account/wizard/pos_box.py @@ -40,6 +40,10 @@ class CashBox(osv.osv_memory): return {} + def _create_bank_statement_line(self, cr, uid, box, record, context=None): + values = self._compute_values_for_statement_line(cr, uid, box, record, context=context) + return self.pool.get('account.bank.statement.line').create(cr, uid, values, context=context) + class CashBoxIn(CashBox): _name = 'cash.box.in' @@ -49,30 +53,24 @@ class CashBoxIn(CashBox): 'ref' : fields.char('Reference', size=32), }) - def _create_bank_statement_line(self, cr, uid, box, record, context=None): - absl_proxy = self.pool.get('account.bank.statement.line') - - values = { + def _compute_values_for_statement_line(self, cr, uid, box, record, context=None): + return { 'statement_id' : record.id, 'journal_id' : record.journal_id.id, 'account_id' : record.journal_id.internal_account_id.id, 'amount' : box.amount or 0.0, - 'ref' : "%s" % (box.ref or ''), + 'ref' : '%s' % (box.ref or ''), 'name' : box.name, } - return absl_proxy.create(cr, uid, values, context=context) - CashBoxIn() class CashBoxOut(CashBox): _name = 'cash.box.out' - def _create_bank_statement_line(self, cr, uid, box, record, context=None): - absl_proxy = self.pool.get('account.bank.statement.line') - + def _compute_values_for_statement_line(self, cr, uid, box, record, context=None): amount = box.amount or 0.0 - values = { + return { 'statement_id' : record.id, 'journal_id' : record.journal_id.id, 'account_id' : record.journal_id.internal_account_id.id, @@ -80,6 +78,4 @@ class CashBoxOut(CashBox): 'name' : box.name, } - return absl_proxy.create(cr, uid, values, context=context) - CashBoxOut() diff --git a/addons/account_accountant/account_accountant_data.xml b/addons/account_accountant/account_accountant_data.xml index 383b53cf49e..5b563017c62 100644 --- a/addons/account_accountant/account_accountant_data.xml +++ b/addons/account_accountant/account_accountant_data.xml @@ -21,13 +21,14 @@ - - - - Module Accounting and Finance has been installed. - With OpenERP's accounting, you can get an instant access to all your financial data, setup your analytic accounting, forecast your taxes, control your budgets, easily create and send invoices, record bank statements, etc. + + mail.group + + notification + Accounting and Finance application installed! + With OpenERP's accounting, you get instant access to your financial data, and can setup analytic accounting, forecast taxes, control budgets, easily create and send invoices, record bank statements, etc. -The accounting features are fully integrated with others OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc. - +The accounting features are fully integrated with other OpenERP applications to automate all your processes: creation of customer invoices, control of supplier invoices, point-of-sale integration, automated follow-ups, etc. + diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index d151d2171a4..1e84681b1ea 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -213,8 +213,6 @@ class account_followup_print_all(osv.osv_memory): mod_obj = self.pool.get('ir.model.data') move_obj = self.pool.get('account.move.line') user_obj = self.pool.get('res.users') - line_obj = self.pool.get('account_followup.stat') - mail_message = self.pool.get('mail.message') if context is None: context = {} @@ -235,13 +233,7 @@ class account_followup_print_all(osv.osv_memory): total_amt += line.debit - line.credit dest = False if partner: - if partner.type=='contact': - if adr.email: - dest = [partner.email] - if (not dest) and partner.type=='default': - if partner.email: - dest = [partner.email] - src = tools.config.options['email_from'] + dest = [partner.email] if not data.partner_lang: body = data.email_body else: @@ -281,7 +273,12 @@ class account_followup_print_all(osv.osv_memory): msg = '' if dest: try: - mail_message.schedule_with_attach(cr, uid, src, dest, sub, body, context=context) + vals = {'state': 'outgoing', + 'subject': sub, + 'body_html': '
%s
' % body, + 'email_to': dest, + 'email_from': data_user.email or tools.config.options['email_from']} + self.pool.get('mail.mail').create(cr, uid, vals, context=context) msg_sent += partner.name + '\n' except Exception, e: raise osv.except_osv('Error !', e ) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 223705af85e..f75cda8cdde 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1293,17 +1293,17 @@ class account_voucher(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s created." % self._document_type[obj.type or False] - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_post(cr, uid, [obj.id], body=message, context=context) def post_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s '%s' is posted." % (self._document_type[obj.type or False], obj.move_id.name) - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_post(cr, uid, [obj.id], body=message, context=context) def reconcile_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): message = "%s reconciled." % self._document_type[obj.type or False] - self.message_append_note(cr, uid, [obj.id], body=message, context=context) + self.message_post(cr, uid, [obj.id], body=message, context=context) account_voucher() diff --git a/addons/account_voucher/account_voucher_data.xml b/addons/account_voucher/account_voucher_data.xml index 8be2851a434..656d2c2cd91 100644 --- a/addons/account_voucher/account_voucher_data.xml +++ b/addons/account_voucher/account_voucher_data.xml @@ -2,15 +2,16 @@ - - - - Module eInvoicing & Payments has been installed. - OpenERP's electronic invoicing allows to ease and fasten the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system. + + mail.group + + notification + eInvoicing & Payments application installed! + OpenERP's electronic invoicing accelerates the creation of invoices and collection of customer payments. Invoices are created in a few clicks and your customers receive them by email. They can pay online and/or import them in their own system. -You can track customer payments easily and automate the reminders. You get an overview of the discussion with your customers on each invoice to ensure a full traceability. +You can track customer payments easily and automate follow-ups. You get an overview of the discussion with your customers on each invoice for easier traceability. -If you want to use advanced accounting features, you should install the "Accounting and Finance" module. - +For advanced accounting features, you should install the "Accounting and Finance" module.
+ diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 7eeb9266e47..d90e2006a71 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -297,7 +297,7 @@ class account_analytic_account(osv.osv): def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), context=context) + self.message_post(cr, uid, [obj.id], body=_("Contract for %s has been created.") % (obj.partner_id.name), context=context) account_analytic_account() diff --git a/addons/auth_openid/static/src/xml/auth_openid.xml b/addons/auth_openid/static/src/xml/auth_openid.xml index aa61d161657..6a40439a012 100644 --- a/addons/auth_openid/static/src/xml/auth_openid.xml +++ b/addons/auth_openid/static/src/xml/auth_openid.xml @@ -4,7 +4,7 @@ -