Issue 9961

Title
Manage incoterms
Priority
feature
Status
testing
Superseder
Add help for each selection (issue 9649)
Project-Id-Version: Roundup 0.7.0 Report-Msgid-Bugs-To: roundup-devel@lists.sourceforge.net POT-Creation-Date: 2020-07-12 23:40-0400 PO-Revision-Date: 2004-11-20 13:47+0200 Language-Team: English Language: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii
Basic distance calculation for parties (issue 10104)
Nosy list
ced, coogor, mrichez, reviewbot
Assigned to
ced
Keywords
review

Created on 2020-12-23.17:44:54 by ced, last changed 3 days ago by mrichez.

Messages

Author: [hidden] (mrichez)
Date: 2021-03-01.10:40:20

Previous error message is when there's no incoterm on purchase.
If i set an incoterm, Error message is still there but different:

Traceback (most recent call last):
File "/trytond/wsgi.py", line 116, in dispatch_request
return endpoint(request, *request.view_args)
File "/trytond/protocols/dispatcher.py", line 47, in rpc
return methods.get(request.rpc_method, _dispatch)(
File "/trytond/wsgi.py", line 83, in auth_required
return wrapped(
args, *kwargs)
File "/trytond/protocols/wrappers.py", line 131, in wrapper
return func(request, pool, *args, *
kwargs)
File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
result = rpc.result(meth(c_args, *c_kwargs))
File "/trytond/wizard/wizard.py", line 314, in execute
return wizard._execute(state_name)
File "/trytond/wizard/wizard.py", line 340, in _execute
do_result = do(action)
File "/trytond/modules/purchase/purchase.py", line 1998, in do_return_
Purchase.save(return_purchases)
File "/trytond/model/descriptors.py", line 33, in newfunc
return self.func(owner, args, *kwargs)
File "/trytond/model/modelstorage.py", line 1777, in save
cls.write(sum(
File "/trytond/model/modelsql.py", line 159, in wrapper
return func(cls, *args, *
kwargs)
File "/trytond/model/modelsql.py", line 980, in write
cls.__check_domain_rule(
File "/trytond/model/modelsql.py", line 1227, in __check_domain_rule
wrong_ids = test_domain(ids, domain)
File "/trytond/model/modelsql.py", line 1202, in test_domain
tables, dom_exp = cls.search_domain(
File "/trytond/model/modelsql.py", line 1427, in search_domain
domain = cls._search_domain_active(domain, active_test=active_test)
File "/trytond/model/modelstorage.py", line 528, in _search_domain_active
if not ('active' in cls._fields
AttributeError: type object 'purchase.purchase' has no attribute '_fields'

Fault: type object 'purchase.purchase' has no attribute '_fields'

Author: [hidden] (mrichez)
Date: 2021-03-01.09:18:04

There's a problem with purchase return wizard. (Create a purchase -> process, click on action -> "return purchases", click on "return")
Tested on trunk version with latest incoterm patch.

Log:

Traceback (most recent call last):
File "/trytond/wsgi.py", line 116, in dispatch_request
return endpoint(request, *request.view_args)
File "/trytond/protocols/dispatcher.py", line 47, in rpc
return methods.get(request.rpc_method, _dispatch)(
File "/trytond/wsgi.py", line 83, in auth_required
return wrapped(
args, *kwargs)
File "/trytond/protocols/wrappers.py", line 131, in wrapper
return func(request, pool, *args, *
kwargs)
File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
result = rpc.result(meth(c_args, *c_kwargs))
File "/trytond/wizard/wizard.py", line 314, in execute
return wizard._execute(state_name)
File "/trytond/wizard/wizard.py", line 340, in _execute
do_result = do(action)
File "/trytond/modules/purchase/purchase.py", line 1992, in do_return_
return_purchases = self.model.copy(purchases)
File "/trytond/modules/purchase/purchase.py", line 704, in copy
return super(Purchase, cls).copy(purchases, default=default)
File "/trytond/model/workflow.py", line 58, in copy
return super().copy(records, default=default)
File "/trytond/ir/resource.py", line 155, in copy
return super().copy(records, default=default)
File "/trytond/ir/resource.py", line 155, in copy
return super().copy(records, default=default)
File "/trytond/model/modelstorage.py", line 402, in copy
ids = list(map(int, records))
TypeError: 'NoneType' object is not iterable

Fault: 'NoneType' object is not iterable

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-02-26.23:43:03
On 2021-02-25 10:28, Maxime Richez wrote:
> * As Incoterm, Shipment_cost_method and carrier are linked together to get available incoterms (list is updated following choices made in carrier and shipment_cost_method fields). Could the field "carrier" move near the incoterm field in the "other info" tab ? 

I do not thin so. The carrier is an important field always needed.
The incoterm is not useful in many cases and it is supposed to be filled
automatically so on correctly configured system it can almost be
forgotten.

> * When choosing "EXW" incoterm, carrier field should be cleared as EXW means no transport.

You can select EXW if the cost method is empty so it means that the
transport is at charge of the buyer.
The carrier is still useful to know the mode of transport.
Normally it is not possible to select an incoterm not valid with the
shipment/carrier selected.

> As EXW, means a departure from factory, could we imagine that default location for this incoterm is selected warehouse address ?

As it is not a constraint I do not think it is good to make choice for
the user.
Also default location can be defined per party.
Author: [hidden] (mrichez)
Date: 2021-02-26.15:32:52

Got an error when i create a new purchase:

Traceback (most recent call last):
File "/trytond/model/model.py", line 367, in _getitem
return getattr(self, field)
AttributeError: 'purchase.purchase._record' object has no attribute '_incoterm_required'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/trytond/model/model.py", line 290, in __getattr__
return self._values[name]
File "/trytond/model/model.py", line 369, in _getitem
raise KeyError(field)
KeyError: '_incoterm_required'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/trytond/wsgi.py", line 116, in dispatch_request
return endpoint(request, *request.view_args)
File "/trytond/protocols/dispatcher.py", line 47, in rpc
return methods.get(request.rpc_method, _dispatch)(
File "/trytond/wsgi.py", line 83, in auth_required
return wrapped(
args, *kwargs)
File "/trytond/protocols/wrappers.py", line 131, in wrapper
return func(request, pool, *args, *
kwargs)
File "/trytond/protocols/dispatcher.py", line 186, in _dispatch
result = rpc.result(meth(inst, c_args, *c_kwargs))
File "/trytond/model/modelview.py", line 818, in on_change
method()
File "/trytond/model/modelview.py", line 88, in wrapper
result = func(self, args, *kwargs)
File "/trytond/model/fields/field.py", line 123, in wrapper
return func(self, args, *kwargs)
File "/trytond/modules/incoterm/common.py", line 118, in on_change_company
self._set_default_incoterm()
File "/trytond/model/fields/field.py", line 123, in wrapper
return func(self, args, *kwargs)
File "/trytond/modules/incoterm/common.py", line 154, in _set_default_incoterm
elif self._incoterm_required:
File "/trytond/model/modelstorage.py", line 1444, in __getattr__
return super(ModelStorage, self).__getattr__(name)
File "/trytond/model/model.py", line 292, in __getattr__
raise AttributeError("'%s' Model has no attribute '%s': %s"
AttributeError: 'purchase.purchase' Model has no attribute '_incoterm_required': <trytond.model.model.purchase.purchase._record object at 0x7f699256f380>

Fault: 'purchase.purchase' Model has no attribute '_incoterm_required': <trytond.model.model.purchase.purchase._record object at 0x7f699256f380>

Author: [hidden] (mrichez)
Date: 2021-02-25.10:28:54

Some more remarks after testing:

  • As Incoterm, Shipment_cost_method and carrier are linked together to get available incoterms (list is updated following choices made in carrier and shipment_cost_method fields). Could the field "carrier" move near the incoterm field in the "other info" tab ?
  • When choosing "EXW" incoterm, carrier field should be cleared as EXW means no transport. As EXW, means a departure from factory, could we imagine that default location for this incoterm is selected warehouse address ?
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-02-22.10:35:24

msg64710 and msg64711 should be fixed in last patchset.

Author: [hidden] (mrichez)
Date: 2021-02-19.15:27:10

Another problem:
- when changing incoterm, incoterm_location is not updated (with location linked on incoterm on the party form)

Author: [hidden] (mrichez)
Date: 2021-02-19.14:56:25

On the party form, help on incoterms field in sale tab says "... Leave empty for all". I think it's a good default behaviour. User has not to add incoterms (and don't know) which one is used for the party.

So i create a new sale with this party (without incoterms defined in the sale tab). In this case, incoterm field in the sale form stay empty. There's only values if i add incoterms on the party form.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-12-23.20:01:08

A place is an address.

Author: [hidden] (mrichez)
Date: 2020-12-23.19:42:35

Hi, don't see any "places" in your model ? I think some incoterms requires this information (harbor location).

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-12-23.17:44:53
History
Date User Action Args
2021-03-01 10:40:20mrichezsetmessages: + msg65032
2021-03-01 09:18:04mrichezsetmessages: + msg65029
2021-02-26 23:43:03cedsetmessages: + msg64894
2021-02-26 23:35:20reviewbotsetmessages: + msg64893
2021-02-26 15:32:52mrichezsetmessages: + msg64882
2021-02-25 10:28:54mrichezsetmessages: + msg64848
2021-02-24 16:43:33reviewbotsetmessages: + msg64821
2021-02-22 17:09:30reviewbotsetmessages: + msg64780
2021-02-22 16:37:19cedsetsuperseder: + Basic distance calculation for parties
2021-02-22 10:39:30reviewbotsetmessages: + msg64777

Showing 10 items. Show all history (warning: this could be VERY long)