-
-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REF] sale_order_type: Split off stock dependent part #1603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
design seems ok, but such refactoring is it allowed on stable ? you are moving data from an installed module to a uninstalled one. people that don't have the new module available on the system will lose the data on production. Don't you think ?
Odoo only drops columns after all upgrades are done, and by that time the _stock module is already installed and has registered the same column names. You can try with |
b5f6916
to
e6351a0
Compare
"and by that time the _stock module is already installed" : that's the point : maybe not. I mean, if you install modules by git clone you'll have the new glue module available in the same time and so it will be installed by dependency, but if you installed original module by other way (by downloading on appstore, or by pip), the new module will not be available, letting production servers in a unstable state. |
You can help ensure the glue module is available in addons path for pip users, by declaring it in the import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
install_requires=[
"odoo13-addon-sale_order_type_stock",
],
) This way, when users Otherwise I'm personally fine with such changes in OCA as we have no "stable policy" and we rather try to follow semver. I'd bump the major version of |
thanks @sbidoul, I'll add that. This will however cause pip users to always get the second module, not only when updating from the pre split version, right? As I don't use it myself I'm fine with that, but if there's a simple way to add this in case we're updating, and not if not, I'll be happy to implement that too. Or don't we care this in installed on the python level, but not by Odoo? Then there's nothing to do. History is a good one, will add that too. |
No, since the setup.py update will be merged together with the split ? Not sure I understand what you mean. |
if I say |
Hi @hbrunn, could you please update your branch as there are new conflicts. Thanks in advance! |
there were some serious changes, I'll need to check how to integrate them with this PR |
e6351a0
to
409772a
Compare
@sbidoul thanks for your input, did as you proposed in the end @JakubWiselka done with rebasing, please review critically to be sure I didn't miss any of the improvements |
1e13922
to
e91a4ce
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Same need #2679 |
a84aa48
to
9e1e67c
Compare
7d6ef0f
to
eb56355
Compare
@@ -1,7 +1,7 @@ | |||
<odoo noupdate="1"> | |||
<record id="normal_sale_type" model="sale.order.type"> | |||
<field name="name">Normal Order</field> | |||
<field name="company_id" eval="False" /> | |||
<field name="company_id" eval="ref('base.main_company')" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made it simpler to test with a db with multiple companies, but I don't mind reverting this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, although I have a couple of questions.
comodel_name="account.payment.term", string="Payment Term", check_company=True | ||
comodel_name="account.payment.term", | ||
string="Payment Term", | ||
sale_order_field="payment_term_id", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it weird that you're removing the check_company=True
across fields like this one.
I guess it was doing nothing because this model doesn't have a company_id
field, but in that case it seems more sensible to add that field, don't you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find that weird too, don't remember my reasoning back then if there was any, will re-add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be named sale_stock_order_type
, as its core base module is sale_stock
. However it's a minor detail, non-blocking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I see it as a derivate of sale_order_type
, and also envision possible other addons like sale_order_type_ecommerce
or similar. What do other reviewers think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK about sale_stock_order_type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but then this doesn't even show up when I search for sale_order_type
, and they also don't sort together. But if you two insist and nobody else takes my side, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add a CONTEXT.rst
file in sale_order_type
to point to this other module. That will help no matter what's the final name.
In any case, I was just suggesting. If you feel more comfortable with the current name, for me it's OK too. 😉
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
as
sale_order_type
can also be very useful in contexts where we don't usestock
, I propose to split the module into a base part withoutstock
and one that autoinstalls when you havestock
. This should also make upgrades for current users work smoothly.