Commit Graph
152 Commits
Author SHA1 Message Date
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Christophe Simonis 4f501348c4 [MERGE] forward port branch saas-16 up to 46e1104ce1 2017-07-26 19:55:44 +02:00
Christophe Simonis 46e1104ce1 [MERGE] forward port branch saas-15 up to 681f03e309 2017-07-26 19:41:57 +02:00
Christophe Simonis 681f03e309 [MERGE] forward port branch saas-14 up to c4e9b854ff 2017-07-26 18:47:54 +02:00
Christophe Simonis e8d4a11e6e [MERGE] forward port branch 10.0 up to 0a089f87fb 2017-07-26 16:56:57 +02:00
Jeremy Kersten df13516679 [FIX] report*: fix missing import from backport #7a1d2d1c4caebba5bd69d63cff3d7824dfd5a7a6 2017-07-20 16:27:44 +02:00
Adrien Dieudonne 7a1d2d1c4c [FIX] *: reports: check required values for 'render_html'
Some reports require additional information to render. When
accessed in Odoo, the user has to fill a wizard to provide those
information. However, when these reports were opened in Studio,
it crashed as those information were missing (we don't pass
through the configuration wizard in this case).

This fix checks if all the required information are given before
trying to render those reports, and it displays a warning in
the logs in they are missing, which is better than a traceback.

backported in v10 for opw-753036
2017-07-20 14:21:57 +02:00
Christophe Simonis fa3e89064a [MERGE] forward port branch saas-16 up to 104dfe3c07 2017-07-20 11:48:49 +02:00
Christophe Simonis 6fa9ea14fa [MERGE] forward port branch saas-15 up to b31cd558e5 2017-07-19 18:48:42 +02:00
Martin Trigaux 47859c393c [I18N] export saas-15 source terms
4 new modules that were not exported
Reword unclear error message
2017-07-17 11:02:33 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00
Christophe Simonis 278e478d55 [MERGE] forward port branch saas-15 up to b141b24706 2017-06-27 12:41:47 +02:00
Adrien Dieudonne 1e4f4299bc [FIX] *: reports: check required values for 'render_html'
Some reports require additional information to render. When
accessed in Odoo, the user has to fill a wizard to provide those
information. However, when these reports were opened in Studio,
it crashed as those information were missing (we don't pass
through the configuration wizard in this case).

This fix checks if all the required information are given before
trying to render those reports, and it displays a warning in
the logs in they are missing, which is better than a traceback.
2017-06-27 11:15:24 +02:00
Christophe Simonis 75f93a9cfe Revert "[FIX] *: reports: check required values for 'render_html'"
This is not how you check that a dict contains keys.

This also break the contract of method `get_html` that may now return
`None`, which `get_pdf` does not handle.

This reverts commit 0d2fb541e8.
2017-06-26 12:43:31 +02:00
Adrien Dieudonne 0d2fb541e8 [FIX] *: reports: check required values for 'render_html'
Some reports require additional information to render. When
accessed in Odoo, the user has to fill a wizard to provide those
information. However, when these reports were opened in Studio,
it crashed as those information were missing (we don't pass
through the configuration wizard in this case).

This fix checks if all the required information are given before
trying to render those reports, and it displays a warning in
the logs in they are missing, which is better than a traceback.
2017-06-19 11:18:37 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Nicolas Martinelli 2ab85a0783 [FIX] hr_payroll: hidden lines
The domain on the "Payslip Lines" has several consequences:
- Lines are duplicated every time the user clicks on "Compute Sheet"
- Contribution registers that have data are not computed because they
  are not visible
- Hidden payslip lines don't go onto accounting entry

We remove the domain, since the purpose of it is to hide the lines in
the payslip of the employee, not hide them in the backend.

Closes #13926
Fixes #13925
Fixes #13987
opw-694011
2016-12-08 09:07:53 +01:00
Yannick Tivisse a3f83916d0 [FIX] report: Pass correctly the docids to render_html method
In the 'get_html' method, the report is using a custom model to render its html,
we should use its own 'render_html' method to generate the report. During the
module migration, we replaced
'report_model.render_html(cr, uid, ids, data=data, context=context)'
by
'report_model.render_html(data=data)'

The new API signature of 'get_html' is

    @api.model
    def get_html(self, docids, report_name, data=None):

That way, 'render_html' doesn't receive docids anymore when called. We should do instead

    if report_model is not None:
        return report_model.browse(docids).render_html(data=data)

As render_html is an api.multi method, this is all wrong too, because we'll send a
browse record with the custom report model to the render_html method, to use the
ids with 'self.ids' that are absolutely not corresponding to the report model but to
to the record model we want to print (an invoice for example).

In old API style we were sending a list of ids, but it's not correct to keep the same
behavior by sending a browse record with only the ids relevant. We have also to
change render_html method decorator to @api.model with a new signature

    @api.model
    def render_html(self, docids, data=None):

And replace the call to render_html by

    if report_model is not None:
        return report_model.render_html(docids, data=data)

In the case the report is printed from a wizard, this is sufficient because the ids
are taken from the active_ids in context, or in data.

In the case the report is printed from a simple action, we should replace the occurence
of 'self.ids' (which doesn't mean anything) to 'docids'

This fix doesn't solve the printing issues for the custom accounting reports, because
the method get_pdf has been reimplemented in the module account_reports.
2016-08-10 11:13:33 +02:00
Ravi Gohil dc6240775f [MIG/IMP] hr_payroll: Migration of report directory to new api,
- removed parser 'payslip_report' as payslip lines can be filtered
  by 'appears_on_payslip' from within the template itself
- Migrated and adjusted code of contribution register and payslip
  details reports(models and templates) so that it can work on multiple records
  - Old code was executed for only one record at a time (even when selected multiple
    records in tree view) and hence the code was developed accordingly, but now,
    return value of methods needed to be change so that it can work on multiple
    record and need qweb templates to be adapted as well.
  - I applied below logic to handle printing of multiple records,
    if previously value returned was [{'a': testa}, {'b': testb, 'c': testc}]
    then new return value will be {'<id of record>': [{'a': testa}, {'b': testb, 'c': testc}]}
- right justified the amount values in all reports
2016-07-11 10:19:49 +02:00
Christophe Simonis 24eebbd25c [MERGE] forward port of branch saas-6 up to 6c6a9f3 2016-05-26 13:56:16 +02:00
Christophe Simonis aa220a5e03 [MERGE] forward port of branch 8.0 up to 6622196 2016-05-26 12:27:56 +02:00
Joren Van Onder be48a1402c [FIX] hr_payroll: avoid infinite recursion
The get_recursive_parent function seemingly depended on the ordering of
the rule_categories recordset which happens to work fine in most cases
because all data first defines the parent before defining the children
rule categories. But if you happen to do it the other way around it
won't work and it will infinitely call itself because:

if rule_categories[0].parent_id:
    rule_categories = rule_categories[0].parent_id | rule_categories

won't change the value of rule_categories[0].

opw-673222 (loosely related)
2016-05-25 09:57:37 +02:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Denis Ledoux aef8a4d618 [MERGE] forward port of branch 8.0 up to f9f7669 2015-12-21 18:24:22 +01:00
Martin Trigaux 44dd7c5077 [FIX] hr_payroll: recursive search of salary rules
.insert() is not possible on a recordset
Generating the payslip details report with at least one payslip category
having a parent, the rendering of the report was crashing.

Closes #9778
2015-12-11 12:48:00 +01:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Simon Lejeune babfb0f78d [IMP] hr* reports converted to qweb
bzr revid: sle@openerp.com-20140415191911-0rttsd7ayk6exm6u
2014-04-15 21:19:11 +02:00
Martin Trigaux c8c298c83c [IMP] clean permissions and shebang in files
bzr revid: mat@openerp.com-20130514103113-8idhvhokt0e8jzea
2013-05-14 12:31:13 +02:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Atul Patel (OpenERP) f715525300 [MERGE]: Merged with lp:openobject-addons
bzr revid: atp@tinyerp.com-20121003064028-49llvt047893tx2n
2012-10-03 12:10:28 +05:30
Atul Patel (OpenERP) 3d6520b3ff [FIX]hr_payroll: Fix if address is not defined.
bzr revid: atp@tinyerp.com-20121003060346-tdakbm44iumvynw8
2012-10-03 11:33:46 +05:30
Atul Patel (OpenERP) 082f70cb6f [MERGE]: Merged display_address() field
bzr revid: atp@tinyerp.com-20121002065832-7wick5qjfbbhy5jv
2012-10-02 12:28:32 +05:30
Nimesh (Open ERP) a9676cfd8c [IMP] amout with currency.
bzr revid: nco@tinyerp.com-20121001110802-r3l169i2ka73t2rh
2012-10-01 16:38:02 +05:30
Numerigraphe - Lionel Sausin 2d2a44dcf2 [FIX] unmutable default in the remaining modules
[REF] coding style consistency

lp bug: https://launchpad.net/bugs/525808 fixed

bzr revid: ls@numerigraphe.fr-20120305184003-er00xtj9vtcw7gna
2012-03-05 19:40:03 +01:00
Rucha (Open ERP) 84a517a6d7 [IMP]: Removed pageSize from report rml as it will be taken from company paper format;
bzr revid: rpa@tinyerp.com-20111221090811-tg1vbfqs303f8yvq
2011-12-21 14:38:11 +05:30
Amit (OpenERP) 7e3dbcf1e9 [IMP]:improved code
bzr revid: apa@tinyerp.com-20111123055221-pnaz34zffzjw1eg2
2011-11-23 11:22:21 +05:30
Purnendu Singh (OpenERP) 971ffbd5cc [FIX] hr_payroll: payslip details report fails while we install hr_payroll_l10n_be module
bzr revid: psi@tinyerp.com-20110914131106-4743bpey6vtvtbxz
2011-09-14 18:41:06 +05:30
psi (Open ERP) 4c37aafc45 [IMP] hr_payroll: remove abs from contribution report
bzr revid: psi@tinyerp.co.in-20110629103110-kjqz620ybuwxxswb
2011-06-29 16:01:10 +05:30
psi (Open ERP) 82b0249a9d [IMP] hr_payroll: Improve the contribution register report so it will now show the lines of confirmed payslips only
bzr revid: psi@tinyerp.co.in-20110629092032-2uq3i90evylxy8zu
2011-06-29 14:50:32 +05:30
Quentin (OpenERP) 42f835eb93 [MERGE] payroll: added the contribution register report
bzr revid: qdp-launchpad@openerp.com-20110616104918-5q5ddzavn39albb5
2011-06-16 12:49:18 +02:00
Quentin (OpenERP) c40c82a1bd [MERGE] removal of unused things in payroll
bzr revid: qdp-launchpad@openerp.com-20110616103949-s260q5cq22u0rria
2011-06-16 12:39:49 +02:00
Quentin (OpenERP) a4f2bb20d2 [MERGE] payroll reports improvements
bzr revid: qdp-launchpad@openerp.com-20110616103051-001utngd2i9iz42v
2011-06-16 12:30:51 +02:00
mtr f63c039f42 [REM] hr_payroll: removed unused reports
bzr revid: mtr@mtr-20110609123723-zhcgfq69ytimxw7h
2011-06-09 18:07:23 +05:30
psi (Open ERP) 5b4effe33d [IMP] hr_payroll: Use formatLang in reports
bzr revid: psi@tinyerp.co.in-20110603103907-y5t7qihsi4efaoj6
2011-06-03 16:09:07 +05:30
psi (Open ERP) 90ecd793ef [IMP] hr_payroll: Used formatLang in reports
bzr revid: psi@tinyerp.co.in-20110603103238-41triu06bx5vworm
2011-06-03 16:02:38 +05:30
psi (Open ERP) 939fed8f4f [IMP] hr_payroll: Increase the width of columns and rename lable
bzr revid: psi@tinyerp.co.in-20110603073917-v9cf1nl1voa9fxvb
2011-06-03 13:09:17 +05:30
psi (Open ERP) d00fb12dd4 [IMP] hr_payroll: small change in total currency symbol in contribution report
bzr revid: psi@tinyerp.co.in-20110602134400-sf0arl7ogxx5vn90
2011-06-02 19:14:00 +05:30