Browse Source

[IMP] Multi Company issue updated 'base_accounting_kit'

pull/165/head
Ajmal JK 5 years ago
parent
commit
3f05288a03
  1. 2
      base_accounting_kit/__manifest__.py
  2. 5
      base_accounting_kit/doc/changelog.md
  3. 6
      base_accounting_kit/models/account_asset.py
  4. 60
      base_accounting_kit/models/account_dashboard.py
  5. 2
      base_accounting_kit/models/account_followup.py
  6. 4
      base_accounting_kit/models/recurring_payments.py
  7. 6
      base_accounting_kit/models/res_partner.py
  8. 14
      base_accounting_kit/report/account_bank_book_view.xml
  9. 14
      base_accounting_kit/report/account_cash_book_view.xml
  10. 14
      base_accounting_kit/report/account_day_book_view.xml
  11. 8
      base_accounting_kit/report/cash_flow_report.xml
  12. 14
      base_accounting_kit/report/general_ledger_report.xml
  13. 10
      base_accounting_kit/report/report_aged_partner.py
  14. 28
      base_accounting_kit/report/report_aged_partner.xml
  15. 10
      base_accounting_kit/report/report_financial.xml
  16. 1
      base_accounting_kit/report/report_journal_audit.py
  17. 14
      base_accounting_kit/report/report_journal_audit.xml
  18. 14
      base_accounting_kit/report/report_partner_ledger.xml
  19. 10
      base_accounting_kit/report/report_tax.xml
  20. 8
      base_accounting_kit/report/report_trial_balance.xml
  21. BIN
      base_accounting_kit/static/description/banner.gif
  22. 1
      base_accounting_kit/static/src/js/account_dashboard.js
  23. 2
      base_accounting_kit/wizard/account_bank_book_wizard.py
  24. 2
      base_accounting_kit/wizard/account_cash_book_wizard.py
  25. 2
      base_accounting_kit/wizard/account_day_book_wizard.py
  26. 2
      base_accounting_kit/wizard/account_lock_date.py
  27. 4
      base_accounting_kit/wizard/financial_report.py

2
base_accounting_kit/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Odoo 13 Full Accounting Kit', 'name': 'Odoo 13 Full Accounting Kit',
'version': '13.0.4.5.6', 'version': '13.0.4.6.7',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management, 'summary': """ Asset and Budget Management,

5
base_accounting_kit/doc/changelog.md

@ -64,3 +64,8 @@
#### Version 13.0.4.5.6 #### Version 13.0.4.5.6
#### UPDT #### UPDT
- Code Optimized-dashboard - Code Optimized-dashboard
#### 24.04.2020
#### Version 13.0.4.6.7
#### IMP
- Multi Company issue updated.

6
base_accounting_kit/models/account_asset.py

@ -57,7 +57,7 @@ class AccountAssetCategory(models.Model):
journal_id = fields.Many2one('account.journal', string='Journal', journal_id = fields.Many2one('account.journal', string='Journal',
required=True) required=True)
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
required=True, default=lambda self: self.env.user.company_id) required=True, default=lambda self: self.env.company)
method = fields.Selection( method = fields.Selection(
[('linear', 'Linear'), ('degressive', 'Degressive')], [('linear', 'Linear'), ('degressive', 'Degressive')],
string='Computation Method', required=True, default='linear', string='Computation Method', required=True, default='linear',
@ -125,11 +125,11 @@ class AccountAssetAsset(models.Model):
required=True, readonly=True, required=True, readonly=True,
states={'draft': [('readonly', False)]}, states={'draft': [('readonly', False)]},
default=lambda default=lambda
self: self.env.user.company_id.currency_id.id) self: self.env.company.currency_id.id)
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
required=True, readonly=True, required=True, readonly=True,
states={'draft': [('readonly', False)]}, states={'draft': [('readonly', False)]},
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company)
note = fields.Text() note = fields.Text()
category_id = fields.Many2one('account.asset.category', string='Category', category_id = fields.Many2one('account.asset.category', string='Category',
required=True, change_default=True, required=True, change_default=True,

60
base_accounting_kit/models/account_dashboard.py

@ -7,6 +7,7 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import models, api from odoo import models, api
from odoo.http import request
class DashBoard(models.Model): class DashBoard(models.Model):
@ -19,7 +20,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_income_this_year(self, *post): def get_income_this_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
month_list = [] month_list = []
for i in range(11, -1, -1): for i in range(11, -1, -1):
@ -116,7 +117,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_income_last_year(self, *post): def get_income_last_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
month_list = [] month_list = []
for i in range(11, -1, -1): for i in range(11, -1, -1):
@ -213,7 +214,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_income_last_month(self, *post): def get_income_last_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
day_list = [] day_list = []
now = datetime.now() now = datetime.now()
day = \ day = \
@ -316,7 +317,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_income_this_month(self, *post): def get_income_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -416,7 +417,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_latebills(self, *post): def get_latebills(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -465,7 +466,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_overdues(self, *post): def get_overdues(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -516,7 +517,7 @@ class DashBoard(models.Model):
else: else:
states_arg = """ state = 'posted'""" states_arg = """ state = 'posted'"""
company_id = self.env.company.id company_id = self.get_current_company_value()
if post[1] == 'this_month': if post[1] == 'this_month':
self._cr.execute((''' self._cr.execute(('''
select to_char(account_move.date, 'Month') as month, res_partner.name as due_partner, account_move.partner_id as parent, select to_char(account_move.date, 'Month') as month, res_partner.name as due_partner, account_move.partner_id as parent,
@ -566,7 +567,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_latebillss(self, *post): def get_latebillss(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
partners = self.env['res.partner'].search([('active', '=', True)]) partners = self.env['res.partner'].search([('active', '=', True)])
@ -627,7 +628,7 @@ class DashBoard(models.Model):
def get_top_10_customers_month(self, *post): def get_top_10_customers_month(self, *post):
record_invoice = {} record_invoice = {}
record_refund = {} record_refund = {}
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post[0] != 'posted': if post[0] != 'posted':
@ -712,7 +713,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_total_invoice(self, *post): def get_total_invoice(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -750,7 +751,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_total_invoice_current_year(self, *post): def get_total_invoice_current_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -839,7 +840,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_total_invoice_current_month(self, *post): def get_total_invoice_current_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -932,7 +933,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_total_invoice_this_month(self, *post): def get_total_invoice_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -980,7 +981,7 @@ class DashBoard(models.Model):
@api.model @api.model
def get_total_invoice_this_year(self): def get_total_invoice_this_year(self):
company_id = self.env.company.id company_id = self.get_current_company_value()
self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice' self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice'
AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) AND AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) AND
@ -1006,7 +1007,7 @@ class DashBoard(models.Model):
@api.model @api.model
def unreconcile_items_this_month(self, *post): def unreconcile_items_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1053,7 +1054,7 @@ class DashBoard(models.Model):
@api.model @api.model
def unreconcile_items_this_year(self, *post): def unreconcile_items_this_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1102,7 +1103,7 @@ class DashBoard(models.Model):
@api.model @api.model
def month_income_this_month(self, *post): def month_income_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1124,7 +1125,7 @@ class DashBoard(models.Model):
@api.model @api.model
def profit_income_this_month(self, *post): def profit_income_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1158,11 +1159,17 @@ class DashBoard(models.Model):
return profit return profit
def get_current_company_value(self):
current_company = request.httprequest.cookies.get('cids')
if current_company:
company_id = current_company[0]
else:
company_id = self.env.company.id
return int(company_id)
@api.model @api.model
def profit_income_this_year(self, *post): def profit_income_this_year(self, *post):
company_id = self.get_current_company_value()
company_id = self.env.company.id
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
states_arg = """ parent_state in ('posted', 'draft')""" states_arg = """ parent_state in ('posted', 'draft')"""
@ -1220,7 +1227,7 @@ class DashBoard(models.Model):
@api.model @api.model
def month_income_this_year(self, *post): def month_income_this_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1254,7 +1261,8 @@ class DashBoard(models.Model):
@api.model @api.model
def get_currency(self): def get_currency(self):
default = self.env.ref('base.main_company').currency_id 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 default = default.symbol
return default return default
@ -1276,7 +1284,7 @@ class DashBoard(models.Model):
@api.model @api.model
def month_expense_this_month(self, *post): def month_expense_this_month(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1302,7 +1310,7 @@ class DashBoard(models.Model):
@api.model @api.model
def month_expense_this_year(self, *post): def month_expense_this_year(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):
@ -1326,7 +1334,7 @@ class DashBoard(models.Model):
@api.model @api.model
def bank_balance(self, *post): def bank_balance(self, *post):
company_id = self.env.company.id company_id = self.get_current_company_value()
states_arg = "" states_arg = ""
if post != ('posted',): if post != ('posted',):

2
base_accounting_kit/models/account_followup.py

@ -31,7 +31,7 @@ class Followup(models.Model):
followup_line_ids = fields.One2many('followup.line', 'followup_id', followup_line_ids = fields.One2many('followup.line', 'followup_id',
'Follow-up', copy=True) 'Follow-up', copy=True)
company_id = fields.Many2one('res.company', 'Company', company_id = fields.Many2one('res.company', 'Company',
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company)
name = fields.Char(related='company_id.name', readonly=True) name = fields.Char(related='company_id.name', readonly=True)

4
base_accounting_kit/models/recurring_payments.py

@ -89,7 +89,7 @@ class RecurringPayments(models.Model):
('pay_later', 'Pay Later')], ('pay_later', 'Pay Later')],
store=True, required=True) store=True, required=True)
company_id = fields.Many2one('res.company', company_id = fields.Many2one('res.company',
default=lambda l: l.env.user.company_id.id) default=lambda l: l.env.company.id)
recurring_lines = fields.One2many('account.recurring.entries.line', 'tmpl_id') recurring_lines = fields.One2many('account.recurring.entries.line', 'tmpl_id')
@api.onchange('partner_id') @api.onchange('partner_id')
@ -156,7 +156,7 @@ class RecurringPayments(models.Model):
vals = { vals = {
'date': line.date, 'date': line.date,
'recurring_ref': recurr_code, 'recurring_ref': recurr_code,
'company_id': self.env.user.company_id.id, 'company_id': self.env.company.id,
'journal_id': tmpl_id.journal_id.id, 'journal_id': tmpl_id.journal_id.id,
'ref': line.template_name, 'ref': line.template_name,
'narration': 'Recurring entry', 'narration': 'Recurring entry',

6
base_accounting_kit/models/res_partner.py

@ -56,7 +56,7 @@ class ResPartner(models.Model):
total_overdue = 0 total_overdue = 0
today = fields.Date.today() today = fields.Date.today()
for am in record.invoice_list: for am in record.invoice_list:
if am.company_id == self.env.user.company_id: if am.company_id == self.env.company:
amount = am.amount_residual amount = am.amount_residual
total_due += amount total_due += amount
is_overdue = today > am.invoice_date_due if am.invoice_date_due else today > am.date is_overdue = today > am.invoice_date_due if am.invoice_date_due else today > am.date
@ -96,13 +96,13 @@ class ResPartner(models.Model):
delay = """select id,delay from followup_line where followup_id = delay = """select id,delay from followup_line where followup_id =
(select id from account_followup where company_id = %s) (select id from account_followup where company_id = %s)
order by delay limit 1""" order by delay limit 1"""
self._cr.execute(delay, [self.env.user.company_id.id]) self._cr.execute(delay, [self.env.company.id])
record = self.env.cr.dictfetchall() record = self.env.cr.dictfetchall()
return record return record
def action_after(self): def action_after(self):
lines = self.env['followup.line'].search([( lines = self.env['followup.line'].search([(
'followup_id.company_id', '=', self.env.user.company_id.id)]) 'followup_id.company_id', '=', self.env.company.id)])
if lines: if lines:
record = self.get_delay() record = self.get_delay()
for i in record: for i in record:

14
base_accounting_kit/report/account_bank_book_view.xml

@ -8,7 +8,7 @@
<t t-call="web.internal_layout"> <t t-call="web.internal_layout">
<div class="page"> <div class="page">
<h2><span t-esc="res_company.name"/>: Bank Book Report <h2><span t-esc="env.company.name"/>: Bank Book Report
</h2> </h2>
<div class="row"> <div class="row">
@ -75,15 +75,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['debit']" <span t-esc="account['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['credit']" <span t-esc="account['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['balance']" <span t-esc="account['balance']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td groups="base.group_multi_currency"/> <td groups="base.group_multi_currency"/>
</tr> </tr>
@ -108,15 +108,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['debit']" <span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['credit']" <span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['balance']" <span t-esc="line['balance']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency"> <td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency">
<span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/> <span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/>

14
base_accounting_kit/report/account_cash_book_view.xml

@ -9,7 +9,7 @@
<t t-call="web.internal_layout"> <t t-call="web.internal_layout">
<div class="page"> <div class="page">
<h2><span t-esc="res_company.name"/>: Cash Book Report</h2> <h2><span t-esc="env.company.name"/>: Cash Book Report</h2>
<div class="row"> <div class="row">
<div class="col-xs-4" style="width:40%;"> <div class="col-xs-4" style="width:40%;">
@ -67,13 +67,13 @@
<span t-esc="account['name']"/> <span t-esc="account['name']"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td groups="base.group_multi_currency"/> <td groups="base.group_multi_currency"/>
</tr> </tr>
@ -85,13 +85,13 @@
<td><span t-esc="line['move_name']"/></td> <td><span t-esc="line['move_name']"/></td>
<td><span t-esc="line['lname']"/></td> <td><span t-esc="line['lname']"/></td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency"> <td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency">
<span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/> <span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/>

14
base_accounting_kit/report/account_day_book_view.xml

@ -7,7 +7,7 @@
<t t-set="data_report_dpi" t-value="110"/> <t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout"> <t t-call="web.internal_layout">
<div class="page"> <div class="page">
<h2><span t-esc="res_company.name"/>: Day Book Report <h2><span t-esc="env.company.name"/>: Day Book Report
</h2> </h2>
<div class="row mt32" style="margin-bottom:3%;"> <div class="row mt32" style="margin-bottom:3%;">
<div class="col-7"> <div class="col-7">
@ -56,15 +56,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['debit']" <span t-esc="account['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['credit']" <span t-esc="account['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['balance']" <span t-esc="account['balance']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td groups="base.group_multi_currency"/> <td groups="base.group_multi_currency"/>
</tr> </tr>
@ -89,15 +89,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['debit']" <span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['credit']" <span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['balance']" <span t-esc="line['balance']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency"> <td t-if="line['amount_currency']" class="text-right" groups="base.group_multi_currency">
<span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/> <span t-esc="line['amount_currency'] if line['amount_currency'] > 0.00 else ''"/>

8
base_accounting_kit/report/cash_flow_report.xml

@ -43,19 +43,19 @@
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('debit')" t-if="data['debit_credit']" <span t-att-style="style" t-esc="a.get('debit')" t-if="data['debit_credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('credit')" t-if="data['debit_credit']" <span t-att-style="style" t-esc="a.get('credit')" t-if="data['debit_credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('balance')" <span t-att-style="style" t-esc="a.get('balance')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="a.get('balance_cmp')" t-if="data['enable_filter']" <span t-att-style="style" t-esc="a.get('balance_cmp')" t-if="data['enable_filter']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</t> </t>
</tr> </tr>

14
base_accounting_kit/report/general_ledger_report.xml

@ -7,7 +7,7 @@
<t t-set="data_report_dpi" t-value="110"/> <t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout"> <t t-call="web.internal_layout">
<div class="page"> <div class="page">
<h2><span t-esc="res_company.name"/>: General ledger</h2> <h2><span t-esc="env.company.name"/>: General ledger</h2>
<div class="row mt32"> <div class="row mt32">
<div class="col-4"> <div class="col-4">
@ -64,13 +64,13 @@
<span t-esc="account['name']"/> <span t-esc="account['name']"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td groups="base.group_multi_currency"/> <td groups="base.group_multi_currency"/>
</tr> </tr>
@ -82,13 +82,13 @@
<td><span t-esc="line['move_name']"/></td> <td><span t-esc="line['move_name']"/></td>
<td><span t-esc="line['lname']"/></td> <td><span t-esc="line['lname']"/></td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="line['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<t t-if="line['amount_currency']"> <t t-if="line['amount_currency']">
<td class="text-right" groups="base.group_multi_currency"> <td class="text-right" groups="base.group_multi_currency">

10
base_accounting_kit/report/report_aged_partner.py

@ -67,7 +67,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
res = [] res = []
total = [] total = []
cr = self.env.cr cr = self.env.cr
user_company = self.env.user.company_id user_company = self.env.company
user_currency = user_company.currency_id user_currency = user_company.currency_id
ResCurrency = self.env['res.currency'].with_context(date=date_from) ResCurrency = self.env['res.currency'].with_context(date=date_from)
company_ids = self._context.get('company_ids') or [user_company.id] company_ids = self._context.get('company_ids') or [user_company.id]
@ -147,7 +147,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
line_amount -= ResCurrency._compute( line_amount -= ResCurrency._compute(
partial_line.company_id.currency_id, user_currency, partial_line.company_id.currency_id, user_currency,
partial_line.amount) partial_line.amount)
if not self.env.user.company_id.currency_id.is_zero(line_amount): if not self.env.company.currency_id.is_zero(line_amount):
undue_amounts[partner_id] += line_amount undue_amounts[partner_id] += line_amount
lines[partner_id].append({ lines[partner_id].append({
'line': line, 'line': line,
@ -207,7 +207,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
partial_line.company_id.currency_id, user_currency, partial_line.company_id.currency_id, user_currency,
partial_line.amount) partial_line.amount)
if not self.env.user.company_id.currency_id.is_zero( if not self.env.company.currency_id.is_zero(
line_amount): line_amount):
partners_amount[partner_id] += line_amount partners_amount[partner_id] += line_amount
lines[partner_id].append({ lines[partner_id].append({
@ -230,7 +230,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
total[6] = total[6] + undue_amt total[6] = total[6] + undue_amt
values['direction'] = undue_amt values['direction'] = undue_amt
if not float_is_zero(values['direction'], if not float_is_zero(values['direction'],
precision_rounding=self.env.user.company_id.currency_id.rounding): precision_rounding=self.env.company.currency_id.rounding):
at_least_one_amount = True at_least_one_amount = True
for i in range(5): for i in range(5):
@ -241,7 +241,7 @@ class ReportAgedPartnerBalance(models.AbstractModel):
total[(i)] = total[(i)] + (during and during[0] or 0) total[(i)] = total[(i)] + (during and during[0] or 0)
values[str(i)] = during and during[0] or 0.0 values[str(i)] = during and during[0] or 0.0
if not float_is_zero(values[str(i)], if not float_is_zero(values[str(i)],
precision_rounding=self.env.user.company_id.currency_id.rounding): precision_rounding=self.env.company.currency_id.rounding):
at_least_one_amount = True at_least_one_amount = True
values['total'] = sum( values['total'] = sum(
[values['direction']] + [values[str(i)] for i in range(5)]) [values['direction']] + [values[str(i)] for i in range(5)])

28
base_accounting_kit/report/report_aged_partner.xml

@ -53,13 +53,13 @@
</tr> </tr>
<tr t-if="get_partner_lines"> <tr t-if="get_partner_lines">
<th>Account Total</th> <th>Account Total</th>
<th class="text-right"><span t-esc="get_direction[6]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[6]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[4]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[4]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[3]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[3]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[2]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[2]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[1]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[1]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[0]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[0]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
<th class="text-right"><span t-esc="get_direction[5]" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></th> <th class="text-right"><span t-esc="get_direction[5]" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -68,25 +68,25 @@
<span t-esc="partner['name']"/> <span t-esc="partner['name']"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['direction']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['direction']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['4']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['4']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['3']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['3']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['2']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['2']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['1']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['1']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['0']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['0']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="partner['total']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-esc="partner['total']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>

10
base_accounting_kit/report/report_financial.xml

@ -57,15 +57,15 @@
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('debit')" <span t-att-style="style" t-esc="a.get('debit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('credit')" <span t-att-style="style" t-esc="a.get('credit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right" style="white-space: text-nowrap;"> <td class="text-right" style="white-space: text-nowrap;">
<span t-att-style="style" t-esc="a.get('balance')" <span t-att-style="style" t-esc="a.get('balance')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</t> </t>
</tr> </tr>
@ -96,7 +96,7 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="a.get('balance')" <span t-att-style="style" t-esc="a.get('balance')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</t> </t>
</tr> </tr>
@ -130,7 +130,7 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="a.get('balance')" <span t-att-style="style" t-esc="a.get('balance')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="a.get('balance_cmp')"/> <span t-att-style="style" t-esc="a.get('balance_cmp')"/>

1
base_accounting_kit/report/report_journal_audit.py

@ -33,7 +33,6 @@ class ReportJournal(models.AbstractModel):
def lines(self, target_move, journal_ids, sort_selection, data): def lines(self, target_move, journal_ids, sort_selection, data):
if isinstance(journal_ids, int): if isinstance(journal_ids, int):
journal_ids = [journal_ids] journal_ids = [journal_ids]
move_state = ['draft', 'posted'] move_state = ['draft', 'posted']
if target_move == 'posted': if target_move == 'posted':
move_state = ['posted'] move_state = ['posted']

14
base_accounting_kit/report/report_journal_audit.xml

@ -19,7 +19,7 @@
<div class="col-3"> <div class="col-3">
<strong>Company:</strong> <strong>Company:</strong>
<p t-esc="res_company.name"/> <p t-esc="env.company.name"/>
</div> </div>
<div class="col-3"> <div class="col-3">
@ -74,11 +74,11 @@
</td> </td>
<td> <td>
<span t-esc="aml.debit" <span t-esc="aml.debit"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td> <td>
<span t-esc="aml.credit" <span t-esc="aml.credit"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td t-if="data['form']['amount_currency'] and aml.amount_currency"> <td t-if="data['form']['amount_currency'] and aml.amount_currency">
<span t-esc="aml.amount_currency" <span t-esc="aml.amount_currency"
@ -97,11 +97,11 @@
</td> </td>
<td> <td>
<span t-esc="sum_debit(data, o)" <span t-esc="sum_debit(data, o)"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td> <td>
<span t-esc="sum_credit(data, o)" <span t-esc="sum_credit(data, o)"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
</table> </table>
@ -129,11 +129,11 @@
</td> </td>
<td> <td>
<span t-esc="taxes[tax]['base_amount']" <span t-esc="taxes[tax]['base_amount']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td> <td>
<span t-esc="taxes[tax]['tax_amount']" <span t-esc="taxes[tax]['tax_amount']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>

14
base_accounting_kit/report/report_partner_ledger.xml

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
<strong>Company:</strong> <strong>Company:</strong>
<p t-esc="res_company.name"/> <p t-esc="env.company.name"/>
</div> </div>
<div class="col-3"> <div class="col-3">
<t t-if="data['form']['date_from']"> <t t-if="data['form']['date_from']">
@ -54,15 +54,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<strong t-esc="sum_partner(data, o, 'debit')" <strong t-esc="sum_partner(data, o, 'debit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<strong t-esc="sum_partner(data, o, 'credit')" <strong t-esc="sum_partner(data, o, 'credit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<strong t-esc="sum_partner(data, o, 'debit - credit')" <strong t-esc="sum_partner(data, o, 'debit - credit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
<tr t-foreach="lines(data, o)" t-as="line"> <tr t-foreach="lines(data, o)" t-as="line">
@ -80,15 +80,15 @@
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['debit']" <span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['credit']" <span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-esc="line['progress']" <span t-esc="line['progress']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right" t-if="data['form']['amount_currency']"> <td class="text-right" t-if="data['form']['amount_currency']">
<t t-if="line['currency_id']"> <t t-if="line['currency_id']">

10
base_accounting_kit/report/report_tax.xml

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
<strong>Company:</strong> <strong>Company:</strong>
<p t-esc="res_company.name"/> <p t-esc="env.company.name"/>
</div> </div>
<div> <div>
<t t-if="data['date_from']"> <t t-if="data['date_from']">
@ -39,11 +39,11 @@
</td> </td>
<td> <td>
<span t-att-style="style" t-esc="line.get('net')" <span t-att-style="style" t-esc="line.get('net')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td> <td>
<span t-att-style="style" t-esc="line.get('tax')" <span t-att-style="style" t-esc="line.get('tax')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
<br/> <br/>
@ -60,11 +60,11 @@
</td> </td>
<td> <td>
<span t-att-style="style" t-esc="line.get('net')" <span t-att-style="style" t-esc="line.get('net')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td> <td>
<span t-att-style="style" t-esc="line.get('tax')" <span t-att-style="style" t-esc="line.get('tax')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
</table> </table>

8
base_accounting_kit/report/report_trial_balance.xml

@ -7,7 +7,7 @@
<t t-set="data_report_dpi" t-value="110"/> <t t-set="data_report_dpi" t-value="110"/>
<t t-call="web.internal_layout"> <t t-call="web.internal_layout">
<div class="page"> <div class="page">
<h2><span t-esc="res_company.name"/>: Trial Balance</h2> <h2><span t-esc="env.company.name"/>: Trial Balance</h2>
<div class="row mt32"> <div class="row mt32">
<div class="col-4"> <div class="col-4">
@ -53,13 +53,13 @@
<span t-att-style="style" t-esc="account['name']"/> <span t-att-style="style" t-esc="account['name']"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-att-style="style" t-esc="account['debit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-att-style="style" t-esc="account['credit']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
<td class="text-right"> <td class="text-right">
<span t-att-style="style" t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/> <span t-att-style="style" t-esc="account['balance']" t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
</td> </td>
</tr> </tr>
</tbody> </tbody>

BIN
base_accounting_kit/static/description/banner.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

1
base_accounting_kit/static/src/js/account_dashboard.js

@ -4,7 +4,6 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var ajax = require('web.ajax'); var ajax = require('web.ajax');
var core = require('web.core'); var core = require('web.core');
var rpc = require('web.rpc'); var rpc = require('web.rpc');
var session = require('web.session');
var web_client = require('web.web_client'); var web_client = require('web.web_client');
var _t = core._t; var _t = core._t;
var QWeb = core.qweb; var QWeb = core.qweb;

2
base_accounting_kit/wizard/account_bank_book_wizard.py

@ -31,7 +31,7 @@ class BankBookWizard(models.TransientModel):
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
readonly=True, readonly=True,
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company)
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')], string='Target Moves', required=True, ('all', 'All Entries')], string='Target Moves', required=True,
default='posted') default='posted')

2
base_accounting_kit/wizard/account_cash_book_wizard.py

@ -31,7 +31,7 @@ class CashBookWizard(models.TransientModel):
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
readonly=True, readonly=True,
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company)
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')], string='Target Moves', required=True, ('all', 'All Entries')], string='Target Moves', required=True,
default='posted') default='posted')

2
base_accounting_kit/wizard/account_day_book_wizard.py

@ -30,7 +30,7 @@ class DayBookWizard(models.TransientModel):
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
readonly=True, readonly=True,
default=lambda self: self.env.user.company_id) default=lambda self: self.env.company)
journal_ids = fields.Many2many('account.journal', string='Journals', journal_ids = fields.Many2many('account.journal', string='Journals',
required=True, required=True,
default=lambda self: self.env[ default=lambda self: self.env[

2
base_accounting_kit/wizard/account_lock_date.py

@ -41,7 +41,7 @@ class AccountUpdateLockDate(models.TransientModel):
@api.model @api.model
def default_get(self, field_list): def default_get(self, field_list):
res = super(AccountUpdateLockDate, self).default_get(field_list) res = super(AccountUpdateLockDate, self).default_get(field_list)
company = self.env.user.company_id company = self.env.company
res.update({ res.update({
'company_id': company.id, 'company_id': company.id,
'period_lock_date': company.period_lock_date, 'period_lock_date': company.period_lock_date,

4
base_accounting_kit/wizard/financial_report.py

@ -68,7 +68,7 @@ class FinancialReport(models.TransientModel):
'res.company', 'res.company',
string='Company', string='Company',
index=True, index=True,
default=lambda self: self.env.user.company_id.id) default=lambda self: self.env.company.id)
def view_report_pdf(self): def view_report_pdf(self):
"""This function will be executed when we click the view button """This function will be executed when we click the view button
@ -370,7 +370,7 @@ class FinancialReport(models.TransientModel):
self.env.context.get('default_journal_id', False)) self.env.context.get('default_journal_id', False))
if journal.currency_id: if journal.currency_id:
return journal.currency_id.id return journal.currency_id.id
return self.env.user.company_id.currency_id.symbol return self.env.company.currency_id.symbol
class ProfitLossPdf(models.AbstractModel): class ProfitLossPdf(models.AbstractModel):

Loading…
Cancel
Save