X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Faccount%2Faccount_invoice.py;h=641c890b1cbb40263abcd8e2f3f3da1c4e6421bd;hb=1d3f8eba879f02da7fc0bb46c9801029eccbc8c8;hp=f916b92d7b87c1dcf6cc6a24f471a3c9b5026b91;hpb=7878b2fd0cb42827b71bd00a1fd8199e73269fe4;p=odoo%2Fodoo.git diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index f916b92..641c890 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -87,7 +87,8 @@ class account_invoice(models.Model): @api.returns('account.analytic.journal', lambda r: r.id) def _get_journal_analytic(self, inv_type): """ Return the analytic journal corresponding to the given invoice type. """ - journal_type = TYPE2JOURNAL.get(inv_type, 'sale') + type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'} + journal_type = type2journal.get(inv_type, 'sale') journal = self.env['account.analytic.journal'].search([('type', '=', journal_type)], limit=1) if not journal: raise except_orm(_('No Analytic Journal!'), @@ -1619,7 +1620,7 @@ class res_partner(models.Model): _inherit = 'res.partner' invoice_ids = fields.One2many('account.invoice', 'partner_id', string='Invoices', - readonly=True) + readonly=True, copy=False) def _find_accounting_partner(self, partner): '''