Daily updates from Odoo
Friday, July 29, 2016
1 change · master
Resolved issues and error corrections
Report generation now accepts different record formats consistently, reducing errors when printing from older or migrated workflows. The first printed report also displays correctly by restoring required report context during PDF generation.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: ## I confirm I have signed the CLA and read the PR guidelines at…
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: ## I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr … as 'docids' 1/ If no docids are passed in get_action (empty list) do not put in context 2/ The method should accept ids or browse records as docids for retrocompatibility. - The api.v7 method took ids as docids - The api.v8 method took a browse records 'records' to call the api.v7 method with 'records.ids' as docids In python, we cannot write 2 functions with the same name that takes differents types for the same argument. The function 'guess' in api.py will lead to a crash if we expect a browse record and we send a list The only way to allow the method to receive different types for the same argument is to decorate it with '@api.noguess' to prevent any effect from guess method. That way, we check directly if 'docids' is an id, ids or a browserecord and we always set a list instead.