Browse Source

[FIX]account_financial_report: Do not add company domain to partner_ids field when the partners are shared among the companies.

pull/539/head
JesusVMayor 6 years ago
parent
commit
d0a81d395b
  1. 4
      account_financial_report/wizard/aged_partner_balance_wizard.py
  2. 4
      account_financial_report/wizard/general_ledger_wizard.py
  3. 4
      account_financial_report/wizard/open_items_wizard.py
  4. 4
      account_financial_report/wizard/trial_balance_wizard.py

4
account_financial_report/wizard/aged_partner_balance_wizard.py

@ -59,11 +59,15 @@ class AgedPartnerBalanceWizard(models.TransientModel):
else: else:
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
if self.env.ref('base.res_partner_rule').active:
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&', '&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False), ('company_id', '=', False),
('parent_id', '=', False)] ('parent_id', '=', False)]
else:
res['domain']['partner_ids'] += [
('parent_id', '=', False)]
return res return res
@api.onchange('receivable_accounts_only', 'payable_accounts_only') @api.onchange('receivable_accounts_only', 'payable_accounts_only')

4
account_financial_report/wizard/general_ledger_wizard.py

@ -167,11 +167,15 @@ class GeneralLedgerReportWizard(models.TransientModel):
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['account_journal_ids'] += [ res['domain']['account_journal_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
if self.env.ref('base.res_partner_rule').active:
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&', '&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False), ('company_id', '=', False),
('parent_id', '=', False)] ('parent_id', '=', False)]
else:
res['domain']['partner_ids'] += [
('parent_id', '=', False)]
res['domain']['cost_center_ids'] += [ res['domain']['cost_center_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
res['domain']['date_range_id'] += [ res['domain']['date_range_id'] += [

4
account_financial_report/wizard/open_items_wizard.py

@ -90,11 +90,15 @@ class OpenItemsReportWizard(models.TransientModel):
else: else:
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
if self.env.ref('base.res_partner_rule').active:
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&', '&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False), ('company_id', '=', False),
('parent_id', '=', False)] ('parent_id', '=', False)]
else:
res['domain']['partner_ids'] += [
('parent_id', '=', False)]
return res return res
@api.onchange('receivable_accounts_only', 'payable_accounts_only') @api.onchange('receivable_accounts_only', 'payable_accounts_only')

4
account_financial_report/wizard/trial_balance_wizard.py

@ -137,11 +137,15 @@ class TrialBalanceReportWizard(models.TransientModel):
else: else:
res['domain']['account_ids'] += [ res['domain']['account_ids'] += [
('company_id', '=', self.company_id.id)] ('company_id', '=', self.company_id.id)]
if self.env.ref('base.res_partner_rule').active:
res['domain']['partner_ids'] += [ res['domain']['partner_ids'] += [
'&', '&',
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False), ('company_id', '=', False),
('parent_id', '=', False)] ('parent_id', '=', False)]
else:
res['domain']['partner_ids'] += [
('parent_id', '=', False)]
res['domain']['date_range_id'] += [ res['domain']['date_range_id'] += [
'|', ('company_id', '=', self.company_id.id), '|', ('company_id', '=', self.company_id.id),
('company_id', '=', False)] ('company_id', '=', False)]

Loading…
Cancel
Save