Skip to content
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

12.0 mig sale order line date #703

Closed
wants to merge 20 commits into from

Conversation

mpanarin
Copy link
Contributor

@mpanarin mpanarin commented Oct 1, 2018

Migration of the sale_order_line_date as well as adding the setup directory

@mpanarin mpanarin mentioned this pull request Oct 1, 2018
54 tasks
@pedrobaeza pedrobaeza added this to the 12.0 milestone Oct 2, 2018
@mpanarin
Copy link
Contributor Author

mpanarin commented Oct 2, 2018

Travis is red due to absence of branch 12 in odoo repo

Copy link
Member

@nikul-serpentcs nikul-serpentcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small Change

sale_order_line_date/__init__.py Outdated Show resolved Hide resolved
@tafaRU
Copy link
Member

tafaRU commented Oct 2, 2018

This module cannot be tested on runbot as sale_management is not installed. I'm wondering if it's worth to add it as dependency: what do you think about it?

@mpanarin
Copy link
Contributor Author

mpanarin commented Oct 2, 2018

@tafaRU not sure what you mean.
The module depends only on the core Sale module

@mpanarin
Copy link
Contributor Author

mpanarin commented Oct 2, 2018

@tafaRU nvm, will fix
@nikul-serpentcs

in v12 sale_management is a wrap_around app module. If it's not installed you won't see menuitems like Sale.

@mpanarin
Copy link
Contributor Author

mpanarin commented Oct 2, 2018

@tafaRU @nikul-serpentcs updated

Copy link
Member

@nikul-serpentcs nikul-serpentcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review LGTM

Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO you should remove the related on sale.order.line to allow the field to be set manually on each line.

sale_order_line_date/models/sale_order_line.py Outdated Show resolved Hide resolved
result = super(SaleOrder, self).onchange_requested_date()
if not result:
result = {}
result = super()._onchange_commitment_date() or {}
if not self:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this possible ? 🤔

def onchange_requested_date(self):
# requested_date was renamed to commitment_date
@api.onchange('commitment_date')
def _onchange_commitment_date(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this onchange really needed since the field on sale.order.line is now related to the one on sale.order ?

sale_order_line_date/models/sale_order_line.py Outdated Show resolved Hide resolved
sale_order_line_date/models/sale_order_line.py Outdated Show resolved Hide resolved
Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groups are also missing on the view

sale_order_line_date/views/sale_order_view.xml Outdated Show resolved Hide resolved
sale_order_line_date/views/sale_order_view.xml Outdated Show resolved Hide resolved
sale_order_line_date/views/sale_order_view.xml Outdated Show resolved Hide resolved
grindtildeath and others added 6 commits March 8, 2019 16:00
Co-Authored-By: mpanarin <31699470+mpanarin@users.noreply.github.com>
Co-Authored-By: mpanarin <31699470+mpanarin@users.noreply.github.com>
Co-Authored-By: mpanarin <31699470+mpanarin@users.noreply.github.com>
Co-Authored-By: mpanarin <31699470+mpanarin@users.noreply.github.com>
Co-Authored-By: mpanarin <31699470+mpanarin@users.noreply.github.com>
@grindtildeath
Copy link
Contributor

@mpanarin Just opened a PR on your branch to restore former behaviour : mpanarin#2
@lreficent @aheficent I added this check here : https://github.com/mpanarin/sale-workflow/pull/2/files#diff-f5a53ebb0e1154f5d42ec9cd83645498R21
Probably not the cleanest way to do it, but I tried to respect the legacy code as much as possible and it avoids bad side effect if the write is on lines from different sale.orders.

Restore sale.order.line commitment_date as unrelated to sale.order
Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the suggestion should fix travis issue.


@api.multi
def write(self, vals):
# Force commitment date only if all the lines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Force commitment date only if all the lines
# Force commitment date only if all the lines

@AaronHForgeFlow
Copy link
Contributor

I cannot install sale_stock on runbot 😱

Field effective_date does not exist
Error context:
View sale.order.form.sale.stock
[view_id: 900, xml_id: n/a, model: sale.order, parent_id: 666]
None" while parsing /home/odoo/OCB-12.0/addons/sale_stock/views/sale_order_views.xml:4, near

I reproduced also on local, but still trying to find out the reason.

@LoisRForgeFlow
Copy link
Contributor

@mpanarin are you going to finish this?

@mpanarin
Copy link
Contributor Author

mpanarin commented Jul 11, 2019

@lreficent sorry, but I don't have the time right now. Feel free to resubmit new pr with updates, or open a pr to my fork and I will accept it.

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @mpanarin , it looks like this PR is no working and you are not going to continue. What do you think about closing it and continue in #875 ?

Functionally tested: doesn't work, when trying to add a sale order line:

Error:
Odoo Server Error

Traceback (most recent call last):
File "/.repo_requirements/odoo/odoo/http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/.repo_requirements/odoo/odoo/http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/.repo_requirements/odoo/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/.repo_requirements/odoo/odoo/http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "/.repo_requirements/odoo/odoo/http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/.repo_requirements/odoo/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/.repo_requirements/odoo/odoo/http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "/.repo_requirements/odoo/odoo/http.py", line 941, in call
return self.method(*args, **kw)
File "/.repo_requirements/odoo/odoo/http.py", line 519, in response_wrap
response = f(*args, **kw)
File "/home/odoo/OCB-12.0/addons/web/controllers/main.py", line 962, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/odoo/OCB-12.0/addons/web/controllers/main.py", line 954, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/.repo_requirements/odoo/odoo/api.py", line 745, in call_kw
return _call_kw_model(method, model, args, kwargs)
File "/.repo_requirements/odoo/odoo/api.py", line 718, in _call_kw_model
result = method(recs, *args, **kwargs)
File "/.repo_requirements/odoo/odoo/models.py", line 1376, in load_views
for [v_id, v_type] in views
File "/.repo_requirements/odoo/odoo/models.py", line 1376, in
for [v_id, v_type] in views
File "/home/odoo/OCB-12.0/addons/mail/models/mail_thread.py", line 410, in fields_view_get
res = super(MailThread, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
File "/.repo_requirements/odoo/odoo/models.py", line 1462, in fields_view_get
xarch, xfields = View.postprocess_and_fields(self._name, etree.fromstring(result['arch']), view_id)
File "/.repo_requirements/odoo/odoo/addons/base/models/ir_ui_view.py", line 1106, in postprocess_and_fields
self.raise_view_error(message, view_id)
File "/.repo_requirements/odoo/odoo/addons/base/models/ir_ui_view.py", line 548, in raise_view_error
raise ValueError(message)
ValueError: Field property_valuation does not exist

Error context:
View n/a
[view_id: n/a, xml_id: n/a, model: n/a, parent_id: n/a]

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds requested date to a sales order lines and propagate it to
stock moves and procurements.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this module must depends in stock

"license": "AGPL-3",
# sale_order_dates became part of the sale module in 12.0
"depends": [
"sale_management",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this module should depends in stock and it doesn't

In v11 depenede in sale_order_dates https://github.com/OCA/sale-workflow/blob/11.0/sale_order_line_date/__manifest__.py#L19

Copy link
Contributor

@RLeeOSI RLeeOSI Oct 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V11 depends on sale_order_dates, but the commitment_date field on sale.order was moved to base sale module in V12. So no need for another dependency.
The method _prepare_procurement_values is used by sale_stock, and there needs to be a dependency or else the sale_stock values will overwrite the values from this module.

@ghost
Copy link

ghost commented Oct 16, 2019

Hello everyone there! What is the state of the migration? I need the module working in version 12. Can I contribute in the PR? Thanks in advance.

@LoisRForgeFlow
Copy link
Contributor

Hi @BT-jmolina, seems that it has been abandoned, so you can help by taking over an opening a new Pull Request finishing the job. I'll be glad to review!

@LoisRForgeFlow
Copy link
Contributor

@BT-jmolina Actually there is another PR open, you can review and colaborate there instead: #875.

@OCA/core-maintainers this can be closed as it has been superseded by #875

@MiquelRForgeFlow
Copy link
Contributor

Superseded by #984.

@sbidoul sbidoul closed this Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet