Daily updates from Odoo
Tuesday, January 25, 2022
11 changes
Enhancements to existing features
Lithuanian financial reports now identify relevant accounts directly by account codes instead of relying on report tags. This makes the reports easier to maintain and helps ensure figures remain consistent when tag setups vary.
Original PR description
Improve the financial reports by using account ids instead of using the tags in the domain of the lines. Task id #2612900
Belgian payroll fields now use clearer labels for yes/no values in tracking and import/export flows. This helps users interpret payroll data more consistently when reviewing changes or exchanging data.
Original PR description
Purpose ======= This new field define labels for each boolean value for the tracking and the import / export. Task-2648390
Resolved issues and error corrections
This change restores a previously lost fix for appointment-related HR JavaScript tests after the module was split. It helps keep automated checks reliable so future appointment scheduling changes can be validated with confidence.
Original PR description
With the new hr_appointment module, some of the js tests that were in the appointment module were moved. Fix the changes that were not kept from a previous fix. See initial changes here: odoo/enterprise#23099 task-2695730
Code cleanup and technical improvements
The appointment booking code has been reorganized so each booking, calendar, backend sharing, and customer portal area has a clearer home. This should make future maintenance safer and faster without changing how users book or manage appointments.
Miscellaneous changes
opw-2674775 Forward-Port-Of: odoo/enterprise#23663 Forward-Port-Of: odoo/enterprise#23644
Original PR description
opw-2674775 Forward-Port-Of: odoo/enterprise#23663 Forward-Port-Of: odoo/enterprise#23644
This pull request adds the following financial reports for Portugal: - Profit & Loss (Demonstração de Resultados) - Balance Sheet (Balanço) These have been implemented using the following resource: [https://recipp.ipp.pt/bitstream/10400.22/614/1/DemFinSNC%20Congresso%20Aveiro.pdf](https://recipp.ipp.pt/bitstream/10400.22/614/1/DemFinSNC%20Congresso%20Aveiro.pdf). task-2674543 Forward-Port-Of: odoo/enterprise#22559
Original PR description
This pull request adds the following financial reports for Portugal: - Profit & Loss (Demonstração de Resultados) - Balance Sheet (Balanço) These have been implemented using the following resource: [https://recipp.ipp.pt/bitstream/10400.22/614/1/DemFinSNC%20Congresso%20Aveiro.pdf](https://recipp.ipp.pt/bitstream/10400.22/614/1/DemFinSNC%20Congresso%20Aveiro.pdf). task-2674543 Forward-Port-Of: odoo/enterprise#22559
Before this commit, the 'load more' functionality used a wacky heuristic of using both excluded ids and an offset to get the next lines. This was problematic for multiple reasons: * The offset should have been depending on the number of excluded ids * In order to reduce the number of rpc calls, a removed proposition was directly put in the proposed lines without asking the server. This could cause duplicates in some cases. * The proposed lines were not always correctly reset, causing an
Original PR description
Before this commit, the 'load more' functionality used a wacky heuristic of using both excluded ids and an offset to get the next lines. This was problematic for multiple reasons: * The offset should…
Before this commit, the 'load more' functionality used a wacky heuristic of using both excluded ids and an offset to get the next lines. This was problematic for multiple reasons: * The offset should have been depending on the number of excluded ids * In order to reduce the number of rpc calls, a removed proposition was directly put in the proposed lines without asking the server. This could cause duplicates in some cases. * The proposed lines were not always correctly reset, causing an exponential explosion of propositions every time we changed the mode (doubling each line every time) To fix this, we only use the excluded ids and no more offset. Instead of excluding only the ids of the lines selected, we also exclude the ids of the lines already in the propositions. This should be more understandable, more reliable and more concise. This commit also removes some dead code from a previous functionality to load more banks.statement.line Forward ported from https://github.com/odoo/odoo/pull/40313 Forward-Port-Of: odoo/enterprise#6728
Case: In a financial report base on date range, with a line configured to display the p&l carried forward as such. ``` <record id="report_line_ppl" model="account.financial.html.report.line"> <field name="code">PPL</field> <field name="name">Profit and loss carried forward</field> <field name="sequence" eval="1"/> <field name="level" eval="3"/> <field name="domain" eval="[('account_id.user_type_id.internal_group', 'in', ['income', 'expense'])]"/> <field na
Original PR description
Case: In a financial report base on date range, with a line configured to display the p&l carried forward as such. ``` <record id="report_line_ppl" model="account.financial.html.report.line"> <field…
Case:
In a financial report base on date range, with a line configured to display the
p&l carried forward as such.
```
<record id="report_line_ppl" model="account.financial.html.report.line">
<field name="code">PPL</field>
<field name="name">Profit and loss carried forward</field>
<field name="sequence" eval="1"/>
<field name="level" eval="3"/>
<field name="domain" eval="[('account_id.user_type_id.internal_group', 'in', ['income', 'expense'])]"/>
<field name="formulas">-sum</field>
<field name="special_date_changer">to_beginning_of_period</field>
</record>
```
The line will be showing an amount at 0.
Displaying the P&L selecting a date in 2015 and one at the end of the last period (31/12 as of 24/01), we see
that we have a value that should be shown in the balance sheet amounting to 541.10.
Doing -sum of 541.10 on the above line is necessary in order to balance the balance sheet.
The code executed when calculating a line with a special_date_changer is setting it as such:
```
if self.special_date_changer == 'to_beginning_of_period' and date_from:
date_tmp = fields.Date.from_string(self._context['date_from']) - relativedelta(days=1)
date_to = date_tmp.strftime('%Y-%m-%d')
date_from = False
```
Which seems correct.
But as it doesn't change the mode, we are in a range with only one value (date_to)
When calculating the dates domain in `get_options_date_domain`, as no verification is done on the date_from
it will create a domain as such:
```
domain = [(date_field, '<=', options_date['date_to']), '|', (date_field, '>=', False),
('account_id.user_type_id.include_initial_balance', '=', True)]
```
The `(date_field, '>=', False)` would later be translated in SQL into `("account_move_line"."date" >= NULL)`
when calculating the sum for this line. This is not correct as it would always be False.
Thus, we aim to fix this by ensuring that, if we provide a range without any date_from, we do not append
the second part of the domain that is related to it.
Forward-Port-Of: odoo/enterprise#23628The 'Not Hired' filter was not showing archived records, thus no applicants were showing. Forward-Port-Of: odoo/enterprise#23651
Original PR description
The 'Not Hired' filter was not showing archived records, thus no applicants were showing. Forward-Port-Of: odoo/enterprise#23651
Initial behavior: When trying to generate a payslip with the structure cp200 - Termination fees, an error occurs if the module l10n_be_hr_contract_salary is not installed since the "holiday" field is declared in it. After this commit: It is possible to create the payslip with that structure without the module previously mentionned. If the module is installed, the original computation will be applied. Forward-Port-Of: odoo/enterprise#23300
Original PR description
Initial behavior: When trying to generate a payslip with the structure cp200 - Termination fees, an error occurs if the module l10n_be_hr_contract_salary is not installed since the "holiday" field is declared in it. After this commit: It is possible to create the payslip with that structure without the module previously mentionned. If the module is installed, the original computation will be applied. Forward-Port-Of: odoo/enterprise#23300
Cohort view was still relying on the redundant `event.registration.date_open` field that was removed in commit 1da2af74, part of odoo/odoo#79166. Task-2735458 Forward-Port-Of: odoo/enterprise#23713
Original PR description
Cohort view was still relying on the redundant `event.registration.date_open` field that was removed in commit 1da2af74, part of odoo/odoo#79166. Task-2735458 Forward-Port-Of: odoo/enterprise#23713