[MERGE] hr_payroll_account: Group accounting entries on payslips

Purpose
=======

From a busines point of view

Integration with accounting. A period of pay include journal entries and
payments. We need to generate both from a batch.

The entries must be grouped
- 1 line for salaries
- 1 line for all ATN
- ...

Payroll generate a Sepa document to send to the bank

+ as this part is managed by an accountant add menu entries in the
accounting app.

From a functional point of view:

Debit and credit accounts are defined on the rules (hr.salary.rule)
The journal should be defined on the structure to be foced

Specification
=============

- Usability: the module l10n_be_hr_payroll Should install the accounting
(right now it install invoicing). On the structure, add a journal m2o.

- On rule: add group accouting items on salary rule

- Improve method 'action_payslip_done' to support multiple entries by move.
Generate only one big entry with all payslip. Generate one total line total
for reconciable if group is set.
Now the payslips are no longer calculated individually,
all accounting entries are grouped together when the pay slips are
validated.
This allows you to have a single accounting entry for all validated
payroll records.

- Buttons on batch
- Add 2 buttons on the batch form
- "Create Entry": it will generate a grouped entries according config of
the rule
- "Payment": it generate an xml with all line to send to the bank
See https://www.odoo.com/documentation/user/11.0/accounting/receivables/customer_payments/payment_sepa.html
- Payroll directly generate the xml (no payments in accounting)

- Button on payslips: Everything should be done through the payslips
- create draft entry
- Create SEPA payment xml
- Make appear those buttons on the form only if batch is not set

- Belgian rules for the entries:
- In data for Belgium: https://docs.google.com/spreadsheets/d/1HlnwoExR_O833sij01p7UizSkrMqcm6oF4GvOeIz5lg/edit#gid=0
example of one of our OD: https://drive.google.com/file/d/0B_hhLmdks1wEdXZSQzJIeVBDOXNiNVctczJzUTBQZVBuNkgw/view?usp=sharing

- Create a Journal salaries (type miscelaneous) and apply all structure on
this journal

- Create new accounts to manage this.

- Sepa for payroll should be an option in the setting of payroll
(like in accounting)

- Configure the accounts on the rules when setting a CoA on a company.

Now the payslips are no longer calculated individually,
all accounting entries are grouped together when the pay slips are
validated.

This allows you to have a single accounting entry for all validated
payroll records.

Other notable point in this commit:
- When installing the Belgian Localisation or when installing the
Belgian CoA on a company, configure the accounting data (journal,
accounts on the salary rules)
- Don't create automatically a payslip batch when creating a payslip

TaskID: 1935200

closes odoo/odoo#32924

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Robot Odoo
2019-06-12 01:37:45 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
@@ -35,7 +35,7 @@
</group>
</xpath>
<xpath expr="//field[@name='bank_account_id']" position="replace">
<field name="bank_account_id" context="{'display_partner':True}"/>
<field name="bank_account_id" context="{'display_partner':True}" attrs="{'invisible' : [('address_home_id', '=', False)]}"/>
</xpath>
</data>
</field>
@@ -134,9 +134,12 @@
"a6200","Rémunérations: Administrateurs ou gérants","6200","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6201","Rémunérations: Personnel de direction","6201","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6202","Rémunérations: Employés","6202","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a62021","Précompte professionnel","62021","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a62022","ATN - Employés","62022","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6203","Rémunérations: Ouvriers","6203","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6204","Rémunérations: Autres membres du personnel","6204","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a621","Cotisations patronales d'assurances sociales","621","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6231","Frais de déplacement","6231","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6301","Dotations aux amortissements sur immobilisations incorporelles","6301","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6302","Dotations aux amortissements sur immobilisations corporelles","6302","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a6310","Réductions de valeur sur stocks","631","account.data_account_type_expenses","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
@@ -161,6 +164,7 @@
"a7052","Prestations de services en vue de l'exportation","7052","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a706","Pénalités et dédits obtenus par l'entreprise","706","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a740","Autres produits d'exploitation","740","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a7492","Autres produits d'exploitation","7492","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_operating","False"
"a7500","Revenus des actions","7500","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_financing","False"
"a7501","Revenus des obligations","7501","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_financing","False"
"a7502","Revenus des créances à plus d'un an","7502","account.data_account_type_revenue","l10n_be.l10nbe_chart_template","account.account_tag_financing","False"
1 id name code user_type_id/id chart_template_id/id tag_ids/id reconcile
134 a6200 Rémunérations: Administrateurs ou gérants 6200 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
135 a6201 Rémunérations: Personnel de direction 6201 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
136 a6202 Rémunérations: Employés 6202 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
137 a62021 Précompte professionnel 62021 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
138 a62022 ATN - Employés 62022 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
139 a6203 Rémunérations: Ouvriers 6203 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
140 a6204 Rémunérations: Autres membres du personnel 6204 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
141 a621 Cotisations patronales d'assurances sociales 621 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
142 a6231 Frais de déplacement 6231 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
143 a6301 Dotations aux amortissements sur immobilisations incorporelles 6301 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
144 a6302 Dotations aux amortissements sur immobilisations corporelles 6302 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
145 a6310 Réductions de valeur sur stocks 631 account.data_account_type_expenses l10n_be.l10nbe_chart_template account.account_tag_operating False
164 a7052 Prestations de services en vue de l'exportation 7052 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_operating False
165 a706 Pénalités et dédits obtenus par l'entreprise 706 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_operating False
166 a740 Autres produits d'exploitation 740 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_operating False
167 a7492 Autres produits d'exploitation 7492 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_operating False
168 a7500 Revenus des actions 7500 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_financing False
169 a7501 Revenus des obligations 7501 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_financing False
170 a7502 Revenus des créances à plus d'un an 7502 account.data_account_type_revenue l10n_be.l10nbe_chart_template account.account_tag_financing False