diff --git a/addons/account_cash_basis_base_account/__init__.py b/addons/account_cash_basis_base_account/__init__.py new file mode 100644 index 00000000000..2971a2d9b7f --- /dev/null +++ b/addons/account_cash_basis_base_account/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +import account_tax +import account_partial_reconcile diff --git a/addons/account_cash_basis_base_account/__openerp__.py b/addons/account_cash_basis_base_account/__openerp__.py new file mode 100644 index 00000000000..1b012f8c7a0 --- /dev/null +++ b/addons/account_cash_basis_base_account/__openerp__.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. +{ + 'name' : 'Tax Cash Basis Edit Base Account', + 'version' : '1.0', + 'summary': 'Add a custom account to handle base amount lines', + 'sequence': 5, + 'description': """ +Move the cash basis lines to another account. + """, + 'category': 'Accounting', + 'depends': ['account_tax_cash_basis'], + 'data': [ + 'views/account_tax_views.xml', + ], + 'installable': True, + 'auto_install': True, +} diff --git a/addons/account_cash_basis_base_account/account_partial_reconcile.py b/addons/account_cash_basis_base_account/account_partial_reconcile.py new file mode 100644 index 00000000000..6e51ac61e7a --- /dev/null +++ b/addons/account_cash_basis_base_account/account_partial_reconcile.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from openerp import api, models + + +class AccountPartialReconcileCashBasis(models.Model): + _inherit = 'account.partial.reconcile' + + def _get_tax_cash_basis_base_account(self, line, tax): + if tax.cash_basis_base_account_id: + return tax.cash_basis_base_account_id + return super(AccountPartialReconcileCashBasis, self)._get_tax_cash_basis_base_account(line, tax) diff --git a/addons/account_cash_basis_base_account/account_tax.py b/addons/account_cash_basis_base_account/account_tax.py new file mode 100644 index 00000000000..d8b6c4ca87f --- /dev/null +++ b/addons/account_cash_basis_base_account/account_tax.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +from openerp import api, fields, models + + +class AccountTax(models.Model): + _inherit = 'account.tax' + + cash_basis_base_account_id = fields.Many2one('account.account', domain=[('deprecated', '=', False)], + string='Base Tax Received Account', + help='Account that will be set on lines created in cash basis journal entry and used to keep track of the tax base amount.') diff --git a/addons/account_cash_basis_base_account/views/account_tax_views.xml b/addons/account_cash_basis_base_account/views/account_tax_views.xml new file mode 100644 index 00000000000..68b076bf853 --- /dev/null +++ b/addons/account_cash_basis_base_account/views/account_tax_views.xml @@ -0,0 +1,15 @@ + + + + + tax.form.cash.basis.base.account.inherit + account.tax + + + + + + + + + diff --git a/addons/account_voucher/models/account_voucher.py b/addons/account_voucher/models/account_voucher.py index 2dfcd06835a..b9dce93cdc9 100644 --- a/addons/account_voucher/models/account_voucher.py +++ b/addons/account_voucher/models/account_voucher.py @@ -286,6 +286,9 @@ class AccountVoucher(models.Model): #create one move line per voucher line where amount is not 0.0 if not line.price_subtotal: continue + line_subtotal = line.price_subtotal + if self.voucher_type == 'sale': + line_subtotal = -1 * line.price_subtotal # convert the amount set on the voucher line into the currency of the voucher's company # this calls res_curreny.compute() with the right context, # so that it will take either the rate on the voucher if it is relevant or will use the default behaviour @@ -302,7 +305,7 @@ class AccountVoucher(models.Model): 'debit': abs(amount) if self.voucher_type == 'purchase' else 0.0, 'date': self.account_date, 'tax_ids': [(4,t.id) for t in line.tax_ids], - 'amount_currency': line.price_subtotal if current_currency != company_currency else 0.0, + 'amount_currency': line_subtotal if current_currency != company_currency else 0.0, 'currency_id': company_currency != current_currency and current_currency or False, 'payment_id': self._context.get('payment_id'), } diff --git a/addons/l10n_ca/data/l10n_ca_chart_data.xml b/addons/l10n_ca/data/l10n_ca_chart_data.xml index 8610079a78f..64b7849d9f2 100644 --- a/addons/l10n_ca/data/l10n_ca_chart_data.xml +++ b/addons/l10n_ca/data/l10n_ca_chart_data.xml @@ -29,7 +29,7 @@ 1181 - + GST receivable @@ -37,7 +37,7 @@ 1182 - + PST/QST receivable @@ -45,7 +45,7 @@ 11831 - + HST receivable - 13% @@ -53,7 +53,7 @@ 11832 - + HST receivable - 14% @@ -61,7 +61,7 @@ 11833 - + HST receivable - 15% @@ -79,7 +79,7 @@ 2131 - + GST to pay @@ -87,7 +87,7 @@ 2132 - + PST/QST to pay @@ -95,7 +95,7 @@ 21331 - + HST to pay - 13% @@ -103,7 +103,7 @@ 21332 - + HST to pay - 14% @@ -111,7 +111,7 @@ 21333 - + HST to pay - 15% diff --git a/addons/l10n_fr_pos_cert/models/account_bank_statement.py b/addons/l10n_fr_pos_cert/models/account_bank_statement.py index 28afbf0d549..f0753885bc1 100644 --- a/addons/l10n_fr_pos_cert/models/account_bank_statement.py +++ b/addons/l10n_fr_pos_cert/models/account_bank_statement.py @@ -6,6 +6,7 @@ from openerp.exceptions import UserError class AccountBankStatement(models.Model): _inherit = 'account.bank.statement' + @api.multi def unlink(self): for statement in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user): raise UserError(_('You cannot modify anything on a bank statement (name: %s) that was created by point of sale operations.') % (statement.name,)) @@ -15,6 +16,7 @@ class AccountBankStatement(models.Model): class AccountBankStatementLine(models.Model): _inherit = 'account.bank.statement.line' + @api.multi def unlink(self): for line in self.filtered(lambda s: s.company_id._is_accounting_unalterable() and s.journal_id.journal_user): raise UserError(_('You cannot modify anything on a bank statement line (name: %s) that was created by point of sale operations.') % (line.name,)) diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml index 29a6fea4e08..b6b1f8b26bc 100644 --- a/addons/purchase/test/fifo_price.yml +++ b/addons/purchase/test/fifo_price.yml @@ -3,7 +3,7 @@ - !python {model: res.company}: | company = self.env.ref('base.main_company') - company.currency_id = self.env.ref('base.EUR') + cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [ref('base.EUR'), company.id]) - Set a product as using fifo price - diff --git a/addons/stock_dropshipping/test/lifo_price.yml b/addons/stock_dropshipping/test/lifo_price.yml index 3cff45c24fa..6928d4854c0 100644 --- a/addons/stock_dropshipping/test/lifo_price.yml +++ b/addons/stock_dropshipping/test/lifo_price.yml @@ -2,7 +2,7 @@ Set the company currency as EURO for the sake of repeatibility - !python {model: res.company, id: base.main_company}: | - self.write({'currency_id':ref('base.EUR')}) + cr.execute("UPDATE res_company SET currency_id = %s WHERE id = %s", [ref('base.EUR'), ref('base.main_company')]) - Set product category removal strategy as LIFO diff --git a/doc/cla/individual/thomas-tankengine.md b/doc/cla/individual/thomas-tankengine.md new file mode 100644 index 00000000000..ae3ece9b174 --- /dev/null +++ b/doc/cla/individual/thomas-tankengine.md @@ -0,0 +1,11 @@ +France, 2018-04-04, + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Thomas Lemaire thomas.lemaire@ndp-systemes.fr https://github.com/thomas-tankengine \ No newline at end of file