Skip to content

Commit

Permalink
[IMP] cooperator: Use data function instead of post-init hook to crea…
Browse files Browse the repository at this point in the history
…te sequences on company

Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Jun 14, 2023
1 parent ec96c5a commit fc67b60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
9 changes: 0 additions & 9 deletions cooperator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
from . import models
from . import report
from . import wizard

from odoo import api, SUPERUSER_ID


def _create_cooperator_sequences(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})

companies = env["res.company"].search([])
companies._create_cooperator_sequences()
1 change: 0 additions & 1 deletion cooperator/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@
"demo/users.xml",
],
"application": True,
"post_init_hook": "_create_cooperator_sequences",
}
4 changes: 4 additions & 0 deletions cooperator/data/data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
<field name="code">SUBJ</field>
<field name="type">sale</field>
</record>

<function model="res.company" name="_create_cooperator_sequences">
<value model="res.company" search="[]" />
</function>
</data>
</odoo>

0 comments on commit fc67b60

Please sign in to comment.