Comments (7)
That can be solved providing a migration script (for v7) or post-hook for v8 that fills with one company each empty record.
from multi-company.
right! I'll create a migration script for that.
from multi-company.
@pedrobaeza I just checked the code of odoo,( migration.py), it seems that only when we update the module and the version is higher, the migration script will be executed. However in this case , we wanna run the migration script when the module is first installed. Please let me know if I miss anything. Thanks! :)
from multi-company.
For v7, if you check for version is None
, you can execute it in first install. For v8, you have to use a pre or post-init hook. See an example here:
https://github.com/odoomrp/odoomrp-wip/blob/8.0/quality_control_stock/__openerp__.py#L42
https://github.com/odoomrp/odoomrp-wip/blob/8.0/quality_control_stock/__init__.py#L10
from multi-company.
@pedrobaeza Thanks very much for you answer. I get how it works for v8.
But for v7, What do you mean by 'version is None'. I checked the code again, the migration only works for the module whose state is "to upgrade" (no 'to install' state). I tried putting the version as none, not working.
from multi-company.
Here you can see an example of a migration script with if not version:
condition that fits for performing at first install (not upgrade):
from multi-company.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
from multi-company.
Related Issues (20)
- Odoo v15 mail_multi_company & mail_template_multi_company HOT 2
- It changes automatically the company after sale order confirm HOT 1
- Migration to version 16.0 HOT 12
- [14.0][ADD] purchase_sale_inter_company: Transfer all attribute and attriute values from PO to SO HOT 1
- Multi company email domain + signatures: New module available HOT 4
- multi_company_product reinstall issu HOT 1
- Multi Company Partner Performance HOT 2
- post_init_hook in partner_multi_company need to consider allowed companies of users.
- multicurrency error in payment for another company HOT 1
- [BUG][14.0] `partner_multi_company` removes partner_share from res.partner ir.rule HOT 1
- [14.0] mail_template_multi_company: User of non-default company cannot send mails of subsequently installed modules HOT 1
- Double negation HOT 1
- partner_multi_company restores wrong ir.rule
- [QUESTION] A couple of questions about some parts of code HOT 1
- The Inter-Company tab not getting showed HOT 2
- Migration to version 17.0 HOT 6
- [16.0] Error in Domain Regardless of company_ids Field State HOT 1
- [PROBLEM] Migration from v15 to v16 HOT 2
- Lack of connection to base_multi_company post_init_hook in partner_multi_company and product_multi_company modules in version 16 HOT 1
- Multi-company product variant access error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi-company.