diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index 3a61a451b..b8c7f0567 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Odoo 13 Full Accounting Kit', - 'version': '13.0.4.7.8', + 'version': '13.0.4.8.9', 'category': 'Accounting', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'summary': """ Asset and Budget Management, diff --git a/base_accounting_kit/doc/changelog.md b/base_accounting_kit/doc/changelog.md index 6999ad746..bbf2cc559 100644 --- a/base_accounting_kit/doc/changelog.md +++ b/base_accounting_kit/doc/changelog.md @@ -74,3 +74,11 @@ #### Version 13.0.4.7.8 #### UPDT - Report updated. + +#### 10.06.2020 +#### Version 13.0.4.8.9 +#### UPDT +- Comma separator in Dashboard +- Currency symbol position in Dashboard +- Monthly invoice filter in Dashboard +- Check payment issue, in case of multi payment diff --git a/base_accounting_kit/models/account_asset.py b/base_accounting_kit/models/account_asset.py index 57f0a5c3a..4bf3a14bd 100644 --- a/base_accounting_kit/models/account_asset.py +++ b/base_accounting_kit/models/account_asset.py @@ -586,7 +586,6 @@ class AccountAssetAsset(models.Model): res = super(AccountAssetAsset, self).write(vals) if 'depreciation_line_ids' not in vals and 'state' not in vals: for rec in self: - print("rec",rec) rec.compute_depreciation_board() return res diff --git a/base_accounting_kit/models/account_dashboard.py b/base_accounting_kit/models/account_dashboard.py index 730f39b86..9e246000b 100644 --- a/base_accounting_kit/models/account_dashboard.py +++ b/base_accounting_kit/models/account_dashboard.py @@ -639,6 +639,7 @@ class DashBoard(models.Model): self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount from account_move, res_partner where account_move.commercial_partner_id = res_partner.id + AND account_move.company_id = %s AND account_move.type = 'out_invoice' AND %s AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) @@ -646,13 +647,14 @@ class DashBoard(models.Model): group by parent, customers order by amount desc limit 10 - ''') % (states_arg)) + ''') % (company_id, states_arg)) record_invoice = self._cr.dictfetchall() self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount from account_move, res_partner where account_move.commercial_partner_id = res_partner.id + AND account_move.company_id = %s AND account_move.type = 'out_refund' AND %s AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) @@ -660,7 +662,7 @@ class DashBoard(models.Model): group by parent, customers order by amount desc limit 10 - ''') % (states_arg)) + ''') % (company_id, states_arg)) record_refund = self._cr.dictfetchall() else: @@ -668,6 +670,7 @@ class DashBoard(models.Model): self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount from account_move, res_partner where account_move.commercial_partner_id = res_partner.id + AND account_move.company_id = %s AND account_move.type = 'out_invoice' AND %s AND Extract(month FROM account_move.invoice_date_due) = ''' + str( @@ -675,13 +678,14 @@ class DashBoard(models.Model): group by parent, customers order by amount desc limit 10 - ''') % (states_arg)) + ''') % (company_id, states_arg)) record_invoice = self._cr.dictfetchall() self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount from account_move, res_partner where account_move.commercial_partner_id = res_partner.id + AND account_move.company_id = %s AND account_move.type = 'out_refund' AND %s AND Extract(month FROM account_move.invoice_date_due) = ''' + str( @@ -689,7 +693,7 @@ class DashBoard(models.Model): group by parent, customers order by amount desc limit 10 - ''') % (states_arg)) + ''') % (company_id, states_arg)) record_refund = self._cr.dictfetchall() @@ -928,7 +932,8 @@ class DashBoard(models.Model): paid_supplier_refund_current_month = [item['supplier_refund_paid'] for item in result_paid_supplier_refund_current_month] - return customer_invoice_current_month, credit_note_current_month, supplier_invoice_current_month, refund_current_month, paid_customer_invoice_current_month, paid_supplier_invoice_current_month, paid_customer_credit_current_month, paid_supplier_refund_current_month + currency = self.get_currency() + return customer_invoice_current_month, credit_note_current_month, supplier_invoice_current_month, refund_current_month, paid_customer_invoice_current_month, paid_supplier_invoice_current_month, paid_customer_credit_current_month, paid_supplier_refund_current_month, currency @api.model def get_total_invoice_this_month(self, *post): @@ -1162,10 +1167,12 @@ class DashBoard(models.Model): def get_current_company_value(self): current_company = request.httprequest.cookies.get('cids') if current_company: - company_id = current_company[0] + company_id = int(current_company[0]) else: company_id = self.env.company.id - return int(company_id) + if company_id not in self.env.user.company_ids.ids: + company_id = self.env.company.id + return company_id @api.model def profit_income_this_year(self, *post): @@ -1263,8 +1270,12 @@ class DashBoard(models.Model): def get_currency(self): current_company = self.env['res.company'].browse(self.get_current_company_value()) default = current_company.currency_id or self.env.ref('base.main_company').currency_id - default = default.symbol - return default + lang = self.env.user.lang + if not lang: + lang = 'en_US' + lang = lang.replace("_", '-') + currency = {'position': default.position, 'symbol': default.symbol, 'language': lang} + return currency # function to get total expense diff --git a/base_accounting_kit/models/account_payment.py b/base_accounting_kit/models/account_payment.py index e969b17f2..5a3e2f9e7 100755 --- a/base_accounting_kit/models/account_payment.py +++ b/base_accounting_kit/models/account_payment.py @@ -32,14 +32,20 @@ class AccountRegisterPayments(models.TransientModel): help='Effective date of PDC', copy=False, default=False) - def get_payments_vals(self): - res = super(AccountRegisterPayments, self).get_payments_vals() - if self.payment_method_id == self.env.ref( - 'account_check_printing.account_payment_method_check'): + def _prepare_payment_vals(self, invoices): + res = super(AccountRegisterPayments, self)._prepare_payment_vals(invoices) + # Check payment method is Check or PDC + check_pdc_ids = self.env['account.payment.method'].search([('code', 'in', ['pdc', 'check_printing'])]) + if self.payment_method_id.id in check_pdc_ids.ids: + currency_id = self.env['res.currency'].browse(res['currency_id']) + journal_id = self.env['account.journal'].browse(res['journal_id']) + # Updating values in case of Multi payments res.update({ - 'check_amount_in_words': self.check_amount_in_words, - 'check_manual_sequencing': self.check_manual_sequencing, + 'bank_reference': self.bank_reference, + 'cheque_reference': self.cheque_reference, + 'check_manual_sequencing': journal_id.check_manual_sequencing, 'effective_date': self.effective_date, + 'check_amount_in_words': currency_id.amount_to_text(res['amount']), }) return res diff --git a/base_accounting_kit/static/description/banner.gif b/base_accounting_kit/static/description/banner.gif index dea243cdb..8924ce5a7 100644 Binary files a/base_accounting_kit/static/description/banner.gif and b/base_accounting_kit/static/description/banner.gif differ diff --git a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png index b2126b2e4..67d1d0df3 100644 Binary files a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png and b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png differ diff --git a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png index 34a1de66b..f97d91134 100644 Binary files a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png and b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png differ diff --git a/base_accounting_kit/static/description/index.html b/base_accounting_kit/static/description/index.html index 86b9e1829..edb4019b9 100644 --- a/base_accounting_kit/static/description/index.html +++ b/base_accounting_kit/static/description/index.html @@ -8,19 +8,25 @@
+

Latest Updates

+

Odoo 13 Accounting

Dashboard, Asset Management, Accounting Reports, PDC Management, Account Lock dates, Customer Credit Limit and Follow Ups, Day book, Bank book and Cash book reports in Odoo 13 community edition.

-

New Feature

-

Key Highlights

'); @@ -422,40 +442,46 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) { var selected = $('.btn.btn-tool.selected'); var data = $(selected[0]).data(); var posted = false; + var self = this; if ($('#toggle-two')[0].checked == true) { posted = "posted" } + rpc.query({ + model: "account.move", + method: "get_currency", + }).then(function (result) { + currency = result; + }) rpc.query({ model: "account.move", method: "get_total_invoice_current_month", args: [posted], }) .then(function (result) { - -// $('#total_supplier_invoice_paid').hide(); -// $('#total_supplier_invoice').hide(); -// $('#total_customer_invoice_paid').hide(); -// $('#total_customer_invoice').hide(); -// $('#tot_invoice').hide(); -// $('#tot_supplier_inv').hide(); -// $('#total_supplier_invoice_paid_current_month').empty(); -// $('#total_supplier_invoice_current_month').empty(); -// $('#total_customer_invoice_paid_current_month').empty(); -// $('#total_customer_invoice_current_month').empty(); -// $('#tot_invoice_current_month').empty(); -// $('#tot_supplier_inv_current_month').empty(); -// $('#total_supplier_invoice_paid_current_year').hide(); -// $('#total_supplier_invoice_current_year').hide(); -// $('#total_customer_invoice_paid_current_year').hide(); -// $('#total_customer_invoice_current_year').hide(); -// $('#tot_invoice_current_year').hide(); -// $('#tot_supplier_inv_current_year').hide(); -// $('#total_supplier_invoice_paid_current_month').show(); -// $('#total_supplier_invoice_current_month').show(); -// $('#total_customer_invoice_paid_current_month').show(); -// $('#total_customer_invoice_current_month').show(); -// $('#tot_invoice_current_month').show(); -// $('#tot_supplier_inv_current_month').show(); + $('#total_supplier_invoice_paid').hide(); + $('#total_supplier_invoice').hide(); + $('#total_customer_invoice_paid').hide(); + $('#total_customer_invoice').hide(); + $('#tot_invoice').hide(); + $('#tot_supplier_inv').hide(); + $('#total_supplier_invoice_paid_current_month').empty(); + $('#total_supplier_invoice_current_month').empty(); + $('#total_customer_invoice_paid_current_month').empty(); + $('#total_customer_invoice_current_month').empty(); + $('#tot_invoice_current_month').empty(); + $('#tot_supplier_inv_current_month').empty(); + $('#total_supplier_invoice_paid_current_year').hide(); + $('#total_supplier_invoice_current_year').hide(); + $('#total_customer_invoice_paid_current_year').hide(); + $('#total_customer_invoice_current_year').hide(); + $('#tot_invoice_current_year').hide(); + $('#tot_supplier_inv_current_year').hide(); + $('#total_supplier_invoice_paid_current_month').show(); + $('#total_supplier_invoice_current_month').show(); + $('#total_customer_invoice_paid_current_month').show(); + $('#total_customer_invoice_current_month').show(); + $('#tot_invoice_current_month').show(); + $('#tot_supplier_inv_current_month').show(); var tot_invoice_current_month = result[0][0] var tot_credit_current_month = result[1][0] var tot_supplier_inv_current_month = result[2][0] @@ -477,6 +503,12 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) { $('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month); $('#tot_invoice_current_month').attr("max", customer_invoice_total_current_month); + customer_invoice_paid_current_month = self.format_currency(currency, customer_invoice_paid_current_month); + customer_invoice_total_current_month = self.format_currency(currency, customer_invoice_total_current_month); + supplier_invoice_paid_current_month = self.format_currency(currency, supplier_invoice_paid_current_month); + supplier_invoice_total_current_month = self.format_currency(currency, supplier_invoice_total_current_month); + + $('#total_customer_invoice_paid_current_month').append(''); $('#total_customer_invoice_current_month').append('
'); @@ -578,7 +610,6 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) { args: [posted,f], }) .then(function (result) { - // Doughnut Chart $(document).ready(function () { var options = { @@ -709,7 +740,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) { }) }, + renderElement: function (ev) { + var self = this; $.when(this._super()) .then(function (ev) { @@ -923,6 +956,11 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) { $('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month); $('#tot_invoice_current_month').attr("max", customer_invoice_total_current_month); + currency = result[8] + customer_invoice_paid_current_month = self.format_currency(currency, customer_invoice_paid_current_month); + customer_invoice_total_current_month = self.format_currency(currency, customer_invoice_total_current_month); + supplier_invoice_paid_current_month = self.format_currency(currency, supplier_invoice_paid_current_month); + supplier_invoice_total_current_month = self.format_currency(currency, supplier_invoice_total_current_month); $('#total_customer_invoice_paid_current_month').append(''); $('#total_customer_invoice_current_month').append('