diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index c538614fd0f..019af2cdef5 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -73,7 +73,6 @@ for a particular financial year and for preparation of vouchers there is a modul 'wizard/account_fiscalyear_close_state.xml', 'wizard/account_chart_view.xml', 'wizard/account_tax_chart_view.xml', - 'wizard/account_move_journal_view.xml', 'wizard/account_move_line_reconcile_select_view.xml', 'wizard/account_open_closed_fiscalyear_view.xml', 'wizard/account_move_line_unreconcile_select_view.xml', @@ -128,9 +127,11 @@ for a particular financial year and for preparation of vouchers there is a modul ], 'js': [ 'static/src/js/account_move_reconciliation.js', + 'static/src/js/account_move_line_quickadd.js', ], 'qweb' : [ "static/src/xml/account_move_reconciliation.xml", + "static/src/xml/account_move_line_quickadd.xml", ], 'css':['static/src/css/account_move_reconciliation.css' ], diff --git a/addons/account/account.py b/addons/account/account.py index cfba30856a9..438dff47aae 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -641,8 +641,7 @@ class account_account(osv.osv): return True def _check_allow_type_change(self, cr, uid, ids, new_type, context=None): - group1 = ['payable', 'receivable', 'other'] - group2 = ['consolidation','view'] + restricted_groups = ['consolidation','view'] line_obj = self.pool.get('account.move.line') for account in self.browse(cr, uid, ids, context=context): old_type = account.type @@ -650,14 +649,25 @@ class account_account(osv.osv): if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): #Check for 'Closed' type if old_type == 'closed' and new_type !='closed': - raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from 'Closed' to any other type which contains journal items!")) - #Check for change From group1 to group2 and vice versa - if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1): - raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from '%s' to '%s' type as it contains journal items!") % (old_type,new_type,)) + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type as it contains journal items!")) + # Forbid to change an account type for restricted_groups as it contains journal items (or if one of its children does) + if (new_type in restricted_groups): + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account to '%s' type as it contains journal items!") % (new_type,)) + + return True + + # For legal reason (forbiden to modify journal entries which belongs to a closed fy or period), Forbid to modify + # the code of an account if journal entries have been already posted on this account. This cannot be simply + # 'configurable' since it can lead to a lack of confidence in OpenERP and this is what we want to change. + def _check_allow_code_change(self, cr, uid, ids, context=None): + line_obj = self.pool.get('account.move.line') + for account in self.browse(cr, uid, ids, context=context): + account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])], context=context) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)], context=context): + raise osv.except_osv(_('Warning !'), _("You cannot change the code of account which contains journal items!")) return True def write(self, cr, uid, ids, vals, context=None): - if context is None: context = {} if not ids: @@ -677,6 +687,8 @@ class account_account(osv.osv): self._check_moves(cr, uid, ids, "write", context=context) if 'type' in vals.keys(): self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) + if 'code' in vals.keys(): + self._check_allow_code_change(cr, uid, ids, context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) def unlink(self, cr, uid, ids, context=None): @@ -685,44 +697,6 @@ class account_account(osv.osv): account_account() -class account_journal_view(osv.osv): - _name = "account.journal.view" - _description = "Journal View" - _columns = { - 'name': fields.char('Journal View', size=64, required=True, translate=True), - 'columns_id': fields.one2many('account.journal.column', 'view_id', 'Columns') - } - _order = "name" - -account_journal_view() - - -class account_journal_column(osv.osv): - - def _col_get(self, cr, user, context=None): - result = [] - cols = self.pool.get('account.move.line')._columns - for col in cols: - if col in ('period_id', 'journal_id'): - continue - result.append( (col, cols[col].string) ) - result.sort() - return result - - _name = "account.journal.column" - _description = "Journal Column" - _columns = { - 'name': fields.char('Column Name', size=64, required=True), - 'field': fields.selection(_col_get, 'Field Name', required=True, size=32), - 'view_id': fields.many2one('account.journal.view', 'Journal View', select=True), - 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True), - 'required': fields.boolean('Required'), - 'readonly': fields.boolean('Readonly'), - } - _order = "view_id, sequence" - -account_journal_column() - class account_journal(osv.osv): _name = "account.journal" _description = "Journal" @@ -738,7 +712,6 @@ class account_journal(osv.osv): " Select 'Opening/Closing Situation' for entries generated for new fiscal years."), 'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]), 'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]), - 'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells OpenERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."), 'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"), 'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"), 'centralisation': fields.boolean('Centralised Counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."), @@ -874,37 +847,6 @@ class account_journal(osv.osv): return self.name_get(cr, user, ids, context=context) - def onchange_type(self, cr, uid, ids, type, currency, context=None): - obj_data = self.pool.get('ir.model.data') - user_pool = self.pool.get('res.users') - - type_map = { - 'sale':'account_sp_journal_view', - 'sale_refund':'account_sp_refund_journal_view', - 'purchase':'account_sp_journal_view', - 'purchase_refund':'account_sp_refund_journal_view', - 'cash':'account_journal_bank_view', - 'bank':'account_journal_bank_view', - 'general':'account_journal_view', - 'situation':'account_journal_view' - } - - res = {} - view_id = type_map.get(type, 'account_journal_view') - user = user_pool.browse(cr, uid, uid) - if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency: - view_id = 'account_journal_bank_view_multi' - data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)]) - data = obj_data.browse(cr, uid, data_id[0], context=context) - - res.update({ - 'centralisation':type == 'situation', - 'view_id':data.res_id, - }) - return { - 'value':res - } - account_journal() class account_fiscalyear(osv.osv): @@ -1384,13 +1326,6 @@ class account_move(osv.osv): 'WHERE id IN %s', ('draft', tuple(ids),)) return True - def onchange_line_id(self, cr, uid, ids, line_ids, context=None): - balance = 0.0 - for line in line_ids: - if line[2]: - 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): if context is None: context = {} @@ -1470,6 +1405,11 @@ class account_move(osv.osv): raise osv.except_osv(_('User Error!'), _('You cannot delete a posted journal entry "%s".') % \ move['name']) + for line in move.line_id: + if line.invoice: + raise osv.except_osv(_('User Error!'), + _("Move cannot be deleted if linked to an invoice. (Invoice: %s - Move ID:%s)") % \ + (line.invoice.number,move.name)) line_ids = map(lambda x: x.id, move.line_id) context['journal_id'] = move.journal_id.id context['period_id'] = move.period_id.id @@ -1678,11 +1618,41 @@ class account_move_reconcile(osv.osv): 'line_id': fields.one2many('account.move.line', 'reconcile_id', 'Entry Lines'), 'line_partial_ids': fields.one2many('account.move.line', 'reconcile_partial_id', 'Partial Entry lines'), 'create_date': fields.date('Creation date', readonly=True), + 'opening_reconciliation': fields.boolean('Opening Entries Reconciliation', help="Is this reconciliation produced by the opening of a new fiscal year ?."), } _defaults = { 'name': lambda self,cr,uid,ctx=None: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile', context=ctx) or '/', } + + # You cannot unlink a reconciliation if it is a opening_reconciliation one, + # you should use the generate opening entries wizard for that + def unlink(self, cr, uid, ids, context=None): + for move_rec in self.browse(cr, uid, ids, context=context): + if move_rec.opening_reconciliation: + raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \ + opening/closing fiscal year process.')) + return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context) + + # Look in the line_id and line_partial_ids to ensure the partner is the same or empty + # on all lines. We allow that only for opening/closing period + def _check_same_partner(self, cr, uid, ids, context=None): + for reconcile in self.browse(cr, uid, ids, context=context): + move_lines = [] + if not reconcile.opening_reconciliation: + if reconcile.line_id: + first_partner = reconcile.line_id[0].partner_id.id + move_lines = reconcile.line_id + elif reconcile.line_partial_ids: + first_partner = reconcile.line_partial_ids[0].partner_id.id + move_lines = reconcile.line_partial_ids + if any([line.partner_id.id != first_partner for line in move_lines]): + return False + return True + _constraints = [ + (_check_same_partner, 'You can only reconcile journal items with the same partner.', ['line_id']), + ] + def reconcile_partial_check(self, cr, uid, ids, type='auto', context=None): total = 0.0 for rec in self.browse(cr, uid, ids, context=context): @@ -3161,16 +3131,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): default_account = acc_template_ref.get(template.property_account_income_opening.id) return default_account - def _get_view_id(journal_type): - # Get the journal views - if journal_type in ('general', 'situation'): - data = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_view') - elif journal_type in ('sale_refund', 'purchase_refund'): - data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_refund_journal_view') - else: - data = obj_data.get_object_reference(cr, uid, 'account', 'account_sp_journal_view') - return data and data[1] or False - journal_names = { 'sale': _('Sales Journal'), 'purchase': _('Purchase Journal'), @@ -3200,7 +3160,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'code': journal_codes[journal_type], 'company_id': company_id, 'centralisation': journal_type == 'situation', - 'view_id': _get_view_id(journal_type), 'analytic_journal_id': _get_analytic_journal(journal_type), 'default_credit_account_id': _get_default_account(journal_type, 'credit'), 'default_debit_account_id': _get_default_account(journal_type, 'debit'), @@ -3417,11 +3376,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): ''' obj_data = self.pool.get('ir.model.data') obj_journal = self.pool.get('account.journal') - # Get the id of journal views - tmp = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_bank_view_multi') - view_id_cur = tmp and tmp[1] or False - tmp = obj_data.get_object_reference(cr, uid, 'account', 'account_journal_bank_view') - view_id_cash = tmp and tmp[1] or False + # we need to loop again to find next number for journal code # because we can't rely on the value current_num as, @@ -3447,10 +3402,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'default_debit_account_id': default_account_id, } if line['currency_id']: - vals['view_id'] = view_id_cur vals['currency'] = line['currency_id'] - else: - vals['view_id'] = view_id_cash + return vals def _prepare_bank_account(self, cr, uid, line, new_code, acc_template_ref, ref_acc_bank, company_id, context=None): diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py index c836600d866..f0da630ec1d 100644 --- a/addons/account/account_bank.py +++ b/addons/account/account_bank.py @@ -89,11 +89,6 @@ class bank(osv.osv): } acc_bank_id = obj_acc.create(cr,uid,acc,context=context) - # Get the journal view id - data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')]) - data = obj_data.browse(cr, uid, data_id[0], context=context) - view_id_cash = data.res_id - jour_obj = self.pool.get('account.journal') new_code = 1 while True: @@ -112,7 +107,6 @@ class bank(osv.osv): 'analytic_journal_id': False, 'default_credit_account_id': acc_bank_id, 'default_debit_account_id': acc_bank_id, - 'view_id': view_id_cash } journal_id = jour_obj.create(cr, uid, vals_journal, context=context) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 4422537007f..e7e3f740067 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -311,7 +311,7 @@ class account_bank_statement(osv.osv): 'statement_id': st_line.statement_id.id, 'journal_id': st_line.statement_id.journal_id.id, 'period_id': st_line.statement_id.period_id.id, - 'currency_id': cur_id, + 'currency_id': amount_currency and cur_id, 'amount_currency': amount_currency, 'analytic_account_id': analytic_id, } diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 80a406bb0b7..8d13ec9dc8f 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1073,8 +1073,9 @@ class account_invoice(osv.osv): self.message_post(cr, uid, [inv_id], body=message, context=context) return True - def action_cancel(self, cr, uid, ids, *args): - context = {} # TODO: Use context from arguments + def action_cancel(self, cr, uid, ids, context=None): + if context is None: + context = {} account_move_obj = self.pool.get('account.move') invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids']) move_ids = [] # ones that we will need to remove @@ -1244,12 +1245,15 @@ class account_invoice(osv.osv): ref = invoice.reference else: ref = self._convert_ref(cr, uid, invoice.number) + partner = invoice.partner_id + if partner.parent_id and not partner.is_company: + partner = partner.parent_id # Pay attention to the sign for both debit/credit AND amount_currency l1 = { 'debit': direction * pay_amount>0 and direction * pay_amount, 'credit': direction * pay_amount<0 and - direction * pay_amount, 'account_id': src_account_id, - 'partner_id': invoice.partner_id.id, + 'partner_id': partner.id, 'ref':ref, 'date': date, 'currency_id':currency_id, @@ -1260,7 +1264,7 @@ class account_invoice(osv.osv): 'debit': direction * pay_amount<0 and - direction * pay_amount, 'credit': direction * pay_amount>0 and direction * pay_amount, 'account_id': pay_account_id, - 'partner_id': invoice.partner_id.id, + 'partner_id': partner.id, 'ref':ref, 'date': date, 'currency_id':currency_id, @@ -1377,8 +1381,8 @@ class account_invoice_line(osv.osv): 'origin': fields.char('Source Document', size=256, help="Reference of the document that produced this invoice."), 'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the invoice."), 'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True), - 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), - 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), + 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null', select=True), + 'product_id': fields.many2one('product.product', 'Product', ondelete='set null', select=True), 'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Product Price')), 'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float", diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 5c5a25880cb..48fec608195 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -435,7 +435,7 @@
- Click to specify lists of columns to display for a type of journal. -
- Journal views determine the way you can record entries in - your journal. Select the fields you want to appear in a journal - and determine the sequence in which they will appear. -
- On the journal definition form, you can select the view you - want to use to display journal items related to this journal. -
-- Click to register a new journal item. + Select the period and the journal you want to fill.
This view can be used by accountants in order to quickly record entries in OpenERP. If you want to record a supplier invoice, @@ -1271,7 +1168,6 @@
+ No journal items found. +
+- No journal items found. -
-\n" +" Klik om de zichtbare kolommen van een dagboek te " +"specificeren.\n" +"
\n" +" Dagboekweergaves bepalen de manier waarop boekingen \n" +" ingevoerd kunnen worden. Selecteer de velden welke zichtbaar " +"\n" +" moeten zijn en bepaald de volgorde daarvan.\n" +"
\n" +" In de dagboekinstellingen kan bepaald worden welke gegevens\n" +" zichtbaar zijn bij boekingen in het betreffende dagboek.\n" +"
\n" +" " #. module: account #: help:account.payment.term,active:0 @@ -205,6 +218,8 @@ msgid "" "which is set after generating opening entries from 'Generate Opening " "Entries'." msgstr "" +"U dient het 'Jaarafsluiting dagboek' te definiëren voor het fiscale jaar, " +"nadat u een openingsbalans heeft gemaakt" #. module: account #: field:account.fiscal.position.account,account_src_id:0 @@ -223,6 +238,15 @@ msgid "" " \n" " " msgstr "" +"\n" +" klik hier om een fiscale periode toe te voegen.\n" +"
\n" +" Een fiscale periode is vaak een maand of een kwartaal. " +"Normaal\n" +" zal dit gelijk zijn met de periode van uw Belasting " +"aangifte.\n" +"
\n" +" " #. module: account #: model:ir.actions.act_window,name:account.action_view_created_invoice_dashboard @@ -243,7 +267,7 @@ msgstr "Dagboek: %s" #. module: account #: help:account.config.settings,code_digits:0 msgid "No. of digits to use for account code" -msgstr "" +msgstr "Aantal cijfers voor de rekening code" #. module: account #: help:account.analytic.journal,type:0 @@ -263,6 +287,9 @@ msgid "" "lines for invoices. Leave empty if you don't want to use an analytic account " "on the invoice tax lines by default." msgstr "" +"Geef de kostenplaats welke standaard gebruikt moet worden bij BTW factuur " +"regels. Als u dit veld niet invuld, wordt er standaard geen kostenplaats " +"gebruikt." #. module: account #: model:ir.actions.act_window,name:account.action_account_tax_template_form @@ -298,7 +325,7 @@ msgstr "Belgische overzichten" #. module: account #: model:account.account.type,name:account.account_type_income_view1 msgid "Income View" -msgstr "" +msgstr "View opbrengsten" #. module: account #: help:account.account,user_type:0 @@ -314,7 +341,7 @@ msgstr "" #. module: account #: field:account.config.settings,sale_refund_sequence_next:0 msgid "Next credit note number" -msgstr "" +msgstr "Volgend nummer creditnota" #. module: account #: help:account.config.settings,module_account_voucher:0 @@ -323,6 +350,10 @@ msgid "" "sales, purchase, expense, contra, etc.\n" " This installs the module account_voucher." msgstr "" +"Deze module bevat alle voorzieningen voor registratie van " +"(bank)afschriften.\n" +" " +"hiermee installeert u de module 'account_voucher'" #. module: account #: model:ir.actions.act_window,name:account.action_account_use_model_create_entry @@ -361,6 +392,18 @@ msgid "" " \n" " " msgstr "" +"\n" +" Klik hier om een creditnota te maken. \n" +"
\n" +" Een creditnota is een factuur, waarbij u een bestaande " +"factuur volledig of gedeeltelijk \n" +" crediteert.\n" +"
\n" +" In plaats van handmatig kunt u hiermee een creditnota maken " +"\n" +" direct vanaf de originele factuur.\n" +"
\n" +" " #. module: account #: field:account.journal.column,field:0 @@ -426,12 +469,12 @@ msgstr "Juni" #: code:addons/account/wizard/account_automatic_reconcile.py:148 #, python-format msgid "You must select accounts to reconcile." -msgstr "" +msgstr "Selecteer de grootboekrekeningen die afgeletterd moeten worden." #. module: account #: help:account.config.settings,group_analytic_accounting:0 msgid "Allows you to use the analytic accounting." -msgstr "" +msgstr "stelt u in staat kostenplaatsen te gebruiken" #. module: account #: model:ir.actions.act_window,help:account.action_account_moves_bank @@ -531,6 +574,18 @@ msgid "" "should choose 'Round per line' because you certainly want the sum of your " "tax-included line subtotals to be equal to the total amount with taxes." msgstr "" +"Als u 'afronden per regel' selecteert: voor elke BTW rekening , wordt het " +"BTW bedrag eerst berekend en afgerond voor elke factuur regel en vervolgens " +"worden deze afgeronde bedragen opgeteld, wat leidt tot het totale bedrag " +"voor deze belasting. \r\n" +"\r\n" +"Als u 'afronden globaal' selecteert: voor elke BTW rekening wordt het BTW " +"bedrag berekend voor elke factuur regel. vervolgens zullen deze bedragen " +"worden opgeteld en uiteindelijk wordt dit totale BTW bedrag afgerond. \r\n" +"\r\n" +"Als u verkoopt met BTW inbegrepen, moet u kiezen voor 'afronden per regel', " +"omdat U zeker wil zijn dat de subtotalen van \r\n" +"uw (BTW inbegrepen) regels gelijk zijn aan het totale bedrag met BTW." #. module: account #: model:ir.model,name:account.model_wizard_multi_charts_accounts @@ -600,7 +655,7 @@ msgstr "Bovenliggend doel" #. module: account #: help:account.invoice.line,sequence:0 msgid "Gives the sequence of this line when displaying the invoice." -msgstr "" +msgstr "Geeft de volgorde van de factuur regel bij het tonen van de factuur" #. module: account #: field:account.bank.statement,account_id:0 @@ -679,7 +734,7 @@ msgstr "Niets af te letteren" #. module: account #: field:account.config.settings,decimal_precision:0 msgid "Decimal precision on journal entries" -msgstr "" +msgstr "Aantal decimalen van journaalposten" #. module: account #: selection:account.config.settings,period:0 @@ -713,7 +768,7 @@ msgstr "Rapport waarde" msgid "" "Specified journal does not have any account move entries in draft state for " "this period." -msgstr "" +msgstr "Geselecteerd dagboek heeft geen 'concept'boekingen" #. module: account #: view:account.fiscal.position:0 @@ -768,12 +823,16 @@ msgid "" " \n" " " msgstr "" +"\n" +" Geen journaalposten gevonden.\n" +"
\n" +" " #. module: account #: code:addons/account/account.py:1606 #, python-format msgid "Cannot create move with currency different from .." -msgstr "" +msgstr "U kunt geen boeking doen met een andere valuta dan ..." #. module: account #: model:email.template,report_name:account.email_template_edi_invoice diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index 55d61f5c611..c95e3919012 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.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-11-24 02:52+0000\n" -"PO-Revision-Date: 2012-11-01 08:44+0000\n" +"PO-Revision-Date: 2012-11-28 07:22+0000\n" "Last-Translator: ccdos\n" +" 单击 创建一个新的支票。\n" +"
\n" +" 支票支付表单允许跟踪用支票支付给供应商的过程。\n" +" 当年选择了一个供应商,Openerp 将自动提供 支付\n" +" 方法和支付金额,用于核销待支付的供应商发票和\n" +" 单据。\n" +"
\n" +" " #. module: account_check_writing #: field:account.voucher,allow_check:0 @@ -131,7 +140,7 @@ msgstr "用预先打印的支票" #. module: account_check_writing #: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom msgid "Print Check (Bottom)" -msgstr "" +msgstr "打印支票(底部)" #. module: account_check_writing #: sql_constraint:res.company:0 @@ -148,14 +157,14 @@ msgstr "到期日期" #. module: account_check_writing #: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle msgid "Print Check (Middle)" -msgstr "" +msgstr "打印支票(中间)" #. module: account_check_writing #: constraint:account.journal:0 msgid "" "Configuration error!\n" "The currency chosen should be shared by the default accounts too." -msgstr "" +msgstr "配置错误!" #. module: account_check_writing #: model:ir.model,name:account_check_writing.model_res_company @@ -171,7 +180,7 @@ msgstr "截止余额" #. module: account_check_writing #: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top msgid "Print Check (Top)" -msgstr "" +msgstr "打印支票(顶部)" #. module: account_check_writing #: report:account.print.check.bottom:0 diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index b26458a73af..0617a95c2f0 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -127,7 +127,7 @@A password reset was requested for the OpenERP account linked to this " +"email.
\n" +"\n" +"You may change your password following this link.
\n" +"\n" +"Note: If you did not ask for a password reset, you can safely ignore this " +"email.
" +msgstr "" + +#. module: auth_reset_password +#: sql_constraint:res.users:0 +msgid "You can not have two users with the same login !" +msgstr "Non è possibile avere due utenti con lo stesso login!" + +#. module: auth_reset_password +#: model:ir.model,name:auth_reset_password.model_res_users +msgid "Users" +msgstr "Utenti" + +#. module: auth_reset_password +#: sql_constraint:res.users:0 +msgid "OAuth UID must be unique per provider" +msgstr "il UID OAuth deve essere unico per provider" + +#. module: auth_reset_password +#: view:res.users:0 +msgid "Reset Password" +msgstr "Reimposta Password" + +#. module: auth_reset_password +#: model:email.template,subject:auth_reset_password.reset_password_email +msgid "Password reset" +msgstr "Ripristino password" + +#. module: auth_reset_password +#: constraint:res.users:0 +msgid "Error: Invalid ean code" +msgstr "Errore: codice EAN non valido" + +#. module: auth_reset_password +#: constraint:res.users:0 +msgid "The chosen company is not in the allowed companies for this user" +msgstr "L'azienda scelta non è fra le aziende abilitate per questo utente" + +#. module: auth_reset_password +#. openerp-web +#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 +#, python-format +msgid "Reset password" +msgstr "Reimposta password" diff --git a/addons/auth_reset_password/i18n/zh_CN.po b/addons/auth_reset_password/i18n/zh_CN.po new file mode 100644 index 00000000000..ee06973b4c6 --- /dev/null +++ b/addons/auth_reset_password/i18n/zh_CN.po @@ -0,0 +1,78 @@ +# Chinese (Simplified) translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHORA password reset was requested for the OpenERP account linked to this " +"email.
\n" +"\n" +"You may change your password following this link.
\n" +"\n" +"Note: If you did not ask for a password reset, you can safely ignore this " +"email.
" +msgstr "" +"\n" +"一个关联到这个Email地址的Openerp帐号请求复位密码。\n" +"你可以修改你的密码通过下面这个链接 。\n" +"提醒:如果你没请求复位密码,请忽略这封邮件。" + +#. module: auth_reset_password +#: sql_constraint:res.users:0 +msgid "You can not have two users with the same login !" +msgstr "两个用户不能使用相同的用户名!" + +#. module: auth_reset_password +#: model:ir.model,name:auth_reset_password.model_res_users +msgid "Users" +msgstr "用户" + +#. module: auth_reset_password +#: sql_constraint:res.users:0 +msgid "OAuth UID must be unique per provider" +msgstr "OAuth UID必须是每个提供者唯一的" + +#. module: auth_reset_password +#: view:res.users:0 +msgid "Reset Password" +msgstr "重置密码" + +#. module: auth_reset_password +#: model:email.template,subject:auth_reset_password.reset_password_email +msgid "Password reset" +msgstr "重置密码" + +#. module: auth_reset_password +#: constraint:res.users:0 +msgid "Error: Invalid ean code" +msgstr "错误:无效的(EAN)条码" + +#. module: auth_reset_password +#: constraint:res.users:0 +msgid "The chosen company is not in the allowed companies for this user" +msgstr "选择的公司不属于此用户允许访问的公司。" + +#. module: auth_reset_password +#. openerp-web +#: code:addons/auth_reset_password/static/src/xml/reset_password.xml:7 +#, python-format +msgid "Reset password" +msgstr "重设密码" diff --git a/addons/auth_reset_password/res_users.py b/addons/auth_reset_password/res_users.py index b1039031812..cfac20c76f9 100644 --- a/addons/auth_reset_password/res_users.py +++ b/addons/auth_reset_password/res_users.py @@ -21,6 +21,7 @@ from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT +from openerp.tools.translate import _ from datetime import datetime, timedelta @@ -54,6 +55,8 @@ class res_users(osv.osv): template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_reset_password', 'reset_password_email') assert template._name == 'email.template' for user in self.browse(cr, uid, ids, context): + if not user.email: + raise osv.except_osv(_("Cannot send email: user has no email address."), user.name) self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context) return True diff --git a/addons/auth_reset_password/res_users_view.xml b/addons/auth_reset_password/res_users_view.xml index 9952162ae65..628e95b6ff9 100644 --- a/addons/auth_reset_password/res_users_view.xml +++ b/addons/auth_reset_password/res_users_view.xml @@ -7,11 +7,17 @@\n" +" Click to add a contact in your address book.\n" +"
\n" +" OpenERP helps you easily track all activities related to\n" +" a customer; discussions, history of business opportunities,\n" +" documents, etc.\n" +"
\n" +" " +msgstr "" +"\n" +" Premere per creare un contatto in rubrica.\n" +"
\n" +" OpenERP ti aiuta a tenere traccia delle attività legate\n" +" a clienti, discussioni, storia delle opportunità,\n" +" document, etc.\n" +"\n" +"
\n" +" " + +#. module: contacts +#: model:ir.actions.act_window,name:contacts.action_contacts +#: model:ir.ui.menu,name:contacts.menu_contacts +msgid "Contacts" +msgstr "Contatti" diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 88b2edcd665..c552b1835f2 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -4,7 +4,7 @@\n" +" 单击定义一个评估计划 \n" +"
\n" +" 你能定义评估计划(例如:6个月后首次面谈,然后每年一次).\n" +" 然后每个员工能关联到一个评估计划,这样Openerp 能自动\n" +" 生成一个面谈要求给管理人员和下属.\n" +"
\n" +" " #. module: hr_evaluation #: view:hr_evaluation.plan.phase:0 @@ -405,7 +413,7 @@ msgstr "行动计划" #. module: hr_evaluation #: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr_config msgid "Periodic Appraisal" -msgstr "定义复核" +msgstr "定期评估" #. module: hr_evaluation #: field:hr_evaluation.plan,month_next:0 @@ -438,7 +446,7 @@ msgstr "所有答案" #: view:hr.evaluation.interview:0 #: view:hr_evaluation.evaluation:0 msgid "Answer Survey" -msgstr "" +msgstr "填写问卷" #. module: hr_evaluation #: selection:hr.evaluation.report,month:0 @@ -549,7 +557,7 @@ msgstr " (employee_name)s: 业务伙伴名称" #: field:hr.evaluation.interview,message_is_follower:0 #: field:hr_evaluation.evaluation,message_is_follower:0 msgid "Is a Follower" -msgstr "" +msgstr "是一个关注者" #. module: hr_evaluation #: view:hr.evaluation.report:0 @@ -580,7 +588,7 @@ msgstr "增加筛选条件" #: field:hr_evaluation.evaluation,message_comment_ids:0 #: help:hr_evaluation.evaluation,message_comment_ids:0 msgid "Comments and emails" -msgstr "" +msgstr "评论和电子邮件" #. module: hr_evaluation #: help:hr_evaluation.plan.phase,send_anonymous_employee:0 @@ -733,7 +741,7 @@ msgstr "取消" #. module: hr_evaluation #: constraint:hr.employee:0 msgid "Error! You cannot create recursive hierarchy of Employee(s)." -msgstr "" +msgstr "错误!,你不能创建循环的员工层次" #. module: hr_evaluation #: view:hr.evaluation.report:0 @@ -836,7 +844,7 @@ msgstr "阶段" #. module: hr_evaluation #: selection:hr_evaluation.plan.phase,action:0 msgid "Bottom-Up Appraisal Requests" -msgstr "自下而上的考评申请" +msgstr "自下而上的评估申请" #. module: hr_evaluation #: selection:hr.evaluation.report,month:0 @@ -847,7 +855,7 @@ msgstr "2月" #: view:hr.evaluation.interview:0 #: view:hr_evaluation.evaluation:0 msgid "Interview Appraisal" -msgstr "面谈评估" +msgstr "面谈测评" #. module: hr_evaluation #: field:survey.request,is_evaluation:0 @@ -871,7 +879,7 @@ msgstr "面谈员工" msgid "" "You cannot change state, because some appraisal(s) are in waiting answer or " "draft state." -msgstr "" +msgstr "你不能改变状态,因为有些评估正在等待结果。" #. module: hr_evaluation #: selection:hr.evaluation.report,month:0 @@ -887,7 +895,7 @@ msgstr "评估计划阶段" #: help:hr.evaluation.interview,message_ids:0 #: help:hr_evaluation.evaluation,message_ids:0 msgid "Messages and communication history" -msgstr "" +msgstr "消息和通信历史" #. module: hr_evaluation #: view:hr.evaluation.interview:0 diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv index 092424ef7e6..361a3d8c74f 100644 --- a/addons/hr_expense/security/ir.model.access.csv +++ b/addons/hr_expense/security/ir.model.access.csv @@ -20,5 +20,3 @@ access_account_move_user,account.move.user,account.model_account_move,base.group access_account_move_line_user,account.move.line.user,account.model_account_move_line,base.group_hr_user,1,1,1,1 access_account_analytic_line_user,account.ianalytic.line.user,account.model_account_analytic_line,base.group_hr_user,1,1,1,1 access_account_journal_period_manager,account.journal.period.manager,account.model_account_journal_period,base.group_hr_manager,1,1,1,1 -hr.access_account_journal_view_hruser,account.journal.view hruser,account.model_account_journal_view,base.group_hr_user,1,0,0,0 -hr.access_account_journal_column_hruser,account.journal.column hruser,account.model_account_journal_column,base.group_hr_user,1,0,0,0 diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 1914d30ec05..aba6dd36538 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -3,7 +3,7 @@
No private message.
@@ -64,7 +65,8 @@
No todo.
@@ -84,7 +86,8 @@
}
No message found and no message sent yet.
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 94a5c2d1f41..638d016921b 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -48,7 +48,7 @@
.openerp .oe_mail .oe_msg{
position: relative;
- background: #F4F5FA;
+ background: #EDEDF6;
border-radius: 2px;
margin-bottom: 2px;
min-height: 42px;
@@ -70,7 +70,7 @@
margin-left: 40px;
}
.openerp .oe_mail .oe_msg .oe_msg_footer{
- padding-left: 4px;
+ margin-left: 4px;
padding-top: 3px;
overflow: hidden;
margin-bottom: 4px;
@@ -94,6 +94,10 @@
.openerp .oe_mail .oe_msg .oe_msg_content .oe_msg_body p {
margin-bottom: 0px;
}
+.openerp .oe_mail .oe_msg .oe_msg_content .oe_msg_body * {
+ text-overflow:ellipsis;
+ word-wrap: break-word;
+}
/* a) Indented Messages */
@@ -380,6 +384,10 @@
line-height: 12px;
vertical-align: middle;
}
+.openerp .oe_mail .oe_msg_footer button.oe_post{
+ position: relative;
+ z-index: 2;
+}
.openerp .oe_mail .oe_msg_footer button.oe_attach{
width: 24px;
overflow: hidden;
@@ -387,8 +395,9 @@
}
.openerp .oe_mail .oe_msg_footer button.oe_attach .oe_e{
position: relative;
- top: -1px;
- left: -9px;
+ top: -4px;
+ margin-left: -9px;
+ vertical-align: middle;
filter:none;
}
.openerp .oe_mail .oe_hidden_input_file, .openerp .oe_mail .oe_hidden_input_file form{
@@ -402,8 +411,9 @@
}
.openerp .oe_mail .oe_msg_footer button.oe_full .oe_e{
position: relative;
- top: -1px;
- left: -9px;
+ top: -4px;
+ margin-left: -9px;
+ vertical-align: middle;
filter:none;
}
.openerp .oe_mail button.oe_attach, .openerp .oe_mail button.oe_full{
@@ -418,13 +428,17 @@
color: #7C7BAD;
margin-left: -3px;
}
+.openerp .oe_mail .oe_msg_footer .oe_attachment_file{
+ cursor: pointer;
+}
.openerp .oe_mail .oe_msg_footer .oe_attachment_file .oe_form_binary_file{
display: inline-block;
- margin-left: -47px;
- height: 28px;
- width: 52px;
- margin-top: -6px;
+ margin-left: -122px;
+ height: 22px;
+ width: 128px;
+ margin-top: -4px;
filter:none;
+ cursor: pointer;
}
.openerp .oe_mail .oe_mail_list_recipients{
font-size: 12px;
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 44bb4e9ae09..a5beaac229f 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -204,7 +204,7 @@ openerp.mail = function (session) {
this.subject = datasets.subject || false,
this.name = datasets.name || false,
this.record_name = datasets.record_name || false,
- this.body = datasets.body || false,
+ this.body = datasets.body || '',
this.vote_nb = datasets.vote_nb || 0,
this.has_voted = datasets.has_voted || false,
this.is_favorite = datasets.is_favorite || false,
@@ -508,7 +508,6 @@ openerp.mail = function (session) {
res_model: 'mail.compose.message',
view_mode: 'form',
view_type: 'form',
- action_from: 'mail.ThreadComposeMessage',
views: [[false, 'form']],
target: 'new',
context: context,
@@ -574,12 +573,7 @@ openerp.mail = function (session) {
var message = thread.create_message_object( data[0] );
// insert the message on dom
thread.insert_message( message, root ? undefined : self.$el, root );
- if (thread.parent_message) {
- self.$el.remove();
- self.parent_thread.compose_message = null;
- } else {
- self.on_cancel();
- }
+ self.on_cancel();
});
//session.web.unblockUI();
});
@@ -591,11 +585,11 @@ openerp.mail = function (session) {
*/
on_compose_expandable: function (event) {
- if (!this.stay_open && (!this.show_composer || !this.$('textarea:not(.oe_compact)').val().match(/\S+/))) {
+ if ((!this.stay_open || (event && event.type == 'click')) && (!this.show_composer || !this.$('textarea:not(.oe_compact)').val().match(/\S+/))) {
this.show_composer = !this.show_composer || this.stay_open;
this.reinit();
}
- if (!this.stay_open && this.show_composer) {
+ if (!this.stay_open && this.show_composer && (!event || event.type != 'blur')) {
this.$('textarea:not(.oe_compact):first').focus();
}
return true;
@@ -725,7 +719,7 @@ openerp.mail = function (session) {
on_message_reply:function (event) {
event.stopPropagation();
this.create_thread();
- this.thread.on_compose_message();
+ this.thread.on_compose_message(event);
return false;
},
@@ -833,9 +827,10 @@ openerp.mail = function (session) {
return false;
},
- /*The selected thread and all childs (messages/thread) became read
- * @param {object} mouse envent
- */
+ /* Set the selected thread and all childs as read or unread, based on
+ * read parameter.
+ * @param {boolean} read_value
+ */
on_message_read_unread: function (read_value) {
var self = this;
var messages = [this].concat(this.get_childs());
@@ -958,7 +953,7 @@ openerp.mail = function (session) {
this.options = options.options;
this.options.root_thread = (options.options.root_thread != undefined ? options.options.root_thread : this);
- this.options.show_compose_message = this.options.show_compose_message && (this.options.display_indented_thread >= this.thread_level || !this.thread_level);
+ this.options.show_compose_message = this.options.show_compose_message && !this.thread_level;
// record options and data
this.parent_message= parent.thread!= undefined ? parent : false ;
@@ -995,7 +990,7 @@ openerp.mail = function (session) {
// add message composition form view
if (!this.compose_message) {
this.compose_message = new mail.ThreadComposeMessage(this, this, {
- 'context': this.context,
+ 'context': this.options.compose_as_todo && !this.thread_level ? _.extend(this.context, { 'default_favorite_user_ids': [this.session.uid] }) : this.context,
'options': this.options,
});
if (!this.thread_level || this.thread_level > this.options.display_indented_thread) {
@@ -1136,9 +1131,9 @@ openerp.mail = function (session) {
* Call the on_compose_expandable method to allow the user to write his message.
* (Is call when a user click on "Reply" button)
*/
- on_compose_message: function () {
+ on_compose_message: function (event) {
this.instantiate_compose_message();
- this.compose_message.on_compose_expandable();
+ this.compose_message.on_compose_expandable(event);
return false;
},
@@ -1241,6 +1236,7 @@ openerp.mail = function (session) {
} else {
message.appendTo(self.$el);
}
+ message.$el.hide().fadeIn(500);
return message
},
@@ -1262,6 +1258,9 @@ openerp.mail = function (session) {
// insert the message on dom
thread.insert_message( message, typeof dom_insert_after == 'object' ? dom_insert_after : false);
});
+ if (!records.length && this.options.root_thread == this) {
+ this.no_message();
+ }
},
/**
@@ -1291,8 +1290,10 @@ openerp.mail = function (session) {
var messages = _.sortBy( this.messages, function (val) { return val.id; });
var it = _.indexOf( messages, message );
- var msg_up = messages[it-1];
- var msg_down = messages[it+1];
+ var msg_up = message.$el.prev('.oe_msg');
+ var msg_down = message.$el.next('.oe_msg');
+ var msg_up = msg_up.hasClass('oe_msg_expandable') ? _.find( this.messages, function (val) { return val.$el[0] == msg_up[0]; }) : false;
+ var msg_down = msg_down.hasClass('oe_msg_expandable') ? _.find( this.messages, function (val) { return val.$el[0] == msg_down[0]; }) : false;
var message_dom = [ ["id", "=", message.id] ];
@@ -1397,6 +1398,8 @@ openerp.mail = function (session) {
*... @param {Array} [message_ids] List of ids to fetch by the root thread.
* When you use this option, the domain is not used for the fetch root.
* @param {String} [no_message] Message to display when there are no message
+ * @param {Boolean} [show_link_partner] Display partner (authors, followers...) on link or not
+ * @param {Boolean} [compose_as_todo] The root composer mark automatically the message as todo
*/
init: function (parent, action) {
this._super(parent, action);
@@ -1414,8 +1417,10 @@ openerp.mail = function (session) {
'show_compose_message' : false,
'show_compact_message' : false,
'compose_placeholder': false,
+ 'show_link_partner': true,
'view_inbox': false,
'message_ids': undefined,
+ 'compose_as_todo' : false,
}, this.action.params);
this.action.params.help = this.action.help || false;
@@ -1441,7 +1446,6 @@ openerp.mail = function (session) {
});
this.thread.appendTo( this.$el );
- this.thread.no_message();
if (this.action.params.show_compose_message) {
this.thread.instantiate_compose_message();
@@ -1632,7 +1636,7 @@ openerp.mail = function (session) {
*/
do_searchview_search: function (domains, contexts, groupbys) {
var self = this;
- this.rpc('/web/session/eval_domain_and_context', {
+ session.web.pyeval.eval_domains_and_contexts({
domains: domains || [],
contexts: contexts || [],
group_by_seq: groupbys || []
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index bb787c9a21b..cca908a5d98 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -34,14 +34,14 @@
\n"
+" Нажмите для создания запроса на закупку.\n"
+" \n"
+" Запрос на закупку это шаг перед запросом цен.\n"
+" В запросе на закупку (или тендере) вы вводите необходимые\n"
+" товары и запускаете создание запросов цен у поставщиков.\n"
+" После переговоров и рассмотрения всех предложений\n"
+" вы можете утвердить одни и отменить другие.\n"
+" \n"
+" 单击开始请购单流程。 \n"
+" \n"
+" 请购单是询价单的前面一步,在请购单(采购招标)\n"
+" 中,你能记录你要购买的产品,并产生给供应商的\n"
+" 询价单。谈判后,一旦你复审了所有供应商的 出\n"
+" 价,你能很准一部分,并取消其他的。\n"
+" \n"
+" 单击定义一个新的销售商店。\n"
+" \n"
+" 每个报价单或者销售订单必须关联到一个\n"
+" 商店。为每次特地销售,商店也定义了产\n"
+" 品将被从哪个仓库发货。\n"
+" \n"
+" 单击 为这个客户创建报价单或者订单。\n"
+" \n"
+" OpenERP 将帮你有效地处理完整的销售流程:\n"
+" 报价,销售订单,发运,开票已经支付.\n"
+" \n"
+" 社交特性帮你组织每个订单的讨论,并允许你客户跟踪订单的进度。\n"
+" \n"
+" 单据创建报价单,销售的第一步。\n"
+" \n"
+" OpenERP 将帮你有效地处理完整的销售流程:\n"
+" 报价,销售订单,发运,开票已经支付.\n"
+" \n"
+" 社交特性帮你组织每个订单的讨论,并允许你客户跟踪订单的进度。.\n"
+"
+
+
+
+
+
+
-
+
-
-
-
-