-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] account_accountant_ux: mass partner ledger report
closes #399 Signed-off-by: Filoquin adhoc <[email protected]>
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from odoo import models | ||
from odoo.exceptions import UserError | ||
|
||
class ResPartner(models.Model): | ||
_name = 'res.partner' | ||
_inherit = 'res.partner' | ||
|
||
def open_mass_partner_ledger(self): | ||
selected_partner_ids = self.env.context.get('active_ids') | ||
if len(selected_partner_ids) < 1000: | ||
|
||
action = self.env["ir.actions.actions"]._for_xml_id("account_reports.action_account_report_partner_ledger") | ||
action['params'] = { | ||
|
||
'options': {'partner_ids': selected_partner_ids}, | ||
'ignore_session': 'both', | ||
} | ||
return action | ||
else: | ||
raise UserError('Se deben seleccionar menos de 1000 contactos') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters