diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index dacbc7e2df1..b89c22d529f 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -350,7 +350,7 @@ class AccountInvoice(models.Model): payment_move_line_ids = fields.Many2many('account.move.line', string='Payment Move Lines', compute='_compute_payments', store=True) user_id = fields.Many2one('res.users', string='Salesperson', track_visibility='onchange', readonly=True, states={'draft': [('readonly', False)]}, - default=lambda self: self.env.user) + default=lambda self: self.env.user, copy=False) fiscal_position_id = fields.Many2one('account.fiscal.position', string='Fiscal Position', oldname='fiscal_position', readonly=True, states={'draft': [('readonly', False)]}) commercial_partner_id = fields.Many2one('res.partner', string='Commercial Entity', compute_sudo=True, @@ -998,8 +998,6 @@ class AccountInvoice(models.Model): 'invoice_id': self.id, 'analytic_tag_ids': analytic_tag_ids } - if line['account_analytic_id']: - move_line_dict['analytic_line_ids'] = [(0, 0, line._get_analytic_line())] res.append(move_line_dict) return res @@ -1445,21 +1443,6 @@ class AccountInvoiceLine(models.Model): _description = "Invoice Line" _order = "invoice_id,sequence,id" - @api.multi - def _get_analytic_line(self): - ref = self.invoice_id.number - return { - 'name': self.name, - 'date': self.invoice_id.date_invoice, - 'account_id': self.account_analytic_id.id, - 'unit_amount': self.quantity, - 'amount': self.price_subtotal_signed, - 'product_id': self.product_id.id, - 'product_uom_id': self.uom_id.id, - 'general_account_id': self.account_id.id, - 'ref': ref, - } - @api.one @api.depends('price_unit', 'discount', 'invoice_line_tax_ids', 'quantity', 'product_id', 'invoice_id.partner_id', 'invoice_id.currency_id', 'invoice_id.company_id', diff --git a/addons/account/models/company.py b/addons/account/models/company.py index ed821367846..d73dbf82c64 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -174,7 +174,6 @@ Best Regards,''')) def setting_init_fiscal_year_action(self): """ Called by the 'Fiscal Year Opening' button of the setup bar.""" company = self.env.user.company_id - company.create_op_move_if_non_existant() new_wizard = self.env['account.financial.year.op'].create({'company_id': company.id}) view_id = self.env.ref('account.setup_financial_year_opening_form').id @@ -265,7 +264,7 @@ Best Regards,''')) default_journal = self.env['account.journal'].search([('type', '=', 'general'), ('company_id', '=', self.id)], limit=1) if not default_journal: - raise UserError(_("No miscellaneous journal could be found. Please create one before proceeding.")) + raise UserError(_("Please install a chart of accounts or create a miscellaneous journal before proceeding.")) self.account_opening_move_id = self.env['account.move'].create({ 'name': _('Opening Journal Entry'), diff --git a/addons/account/views/account_portal_templates.xml b/addons/account/views/account_portal_templates.xml index 2ff82b4bc3a..51ac3563c2e 100644 --- a/addons/account/views/account_portal_templates.xml +++ b/addons/account/views/account_portal_templates.xml @@ -179,7 +179,7 @@ -   +   diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index e39b1605d3c..270c792c606 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -88,7 +88,7 @@ -   +   @@ -112,18 +112,18 @@ - - - - - -  on + + + + + + diff --git a/addons/account/views/res_config_settings_views.xml b/addons/account/views/res_config_settings_views.xml index 22726578d1b..7a878d265c7 100644 --- a/addons/account/views/res_config_settings_views.xml +++ b/addons/account/views/res_config_settings_views.xml @@ -168,6 +168,10 @@