Can not quote a sale with negative when party location is none
Scenario 1. A party, customer_location and supplier_location are MultiValue fields and not required. 2. Set the customer_location field to None for a party. 3. Create a sale and add a line with a quantity less than 0 (negative). 4. Quote the sale: ``` Traceback (most recent call last): File "/tryton/tryton/trytond/trytond/protocols/dispatcher.py", line 216, in _dispatch result = rpc.result(meth(*c_args, **c_kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/modelview.py", line 764, in wrapper return func(cls, records, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/workflow.py", line 37, in wrapper result = func(cls, filtered, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/modules/sale_shipment_cost/sale.py", line 225, in quote super(Sale, cls).quote(sales) File "/tryton/tryton/trytond/trytond/model/modelview.py", line 764, in wrapper return func(cls, records, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/workflow.py", line 37, in wrapper result = func(cls, filtered, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/modules/company/model.py", line 66, in wrapper result = func(cls, records, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/modules/sale/sale.py", line 1038, in quote sale.check_for_quotation() File "/tryton/tryton/trytond/trytond/modules/sale_shipment_cost/sale.py", line 202, in check_for_quotation super().check_for_quotation() File "/tryton/tryton/trytond/trytond/modules/sale/sale.py", line 834, in check_for_quotation location = line.from_location ^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/modelstorage.py", line 1856, in __getattr__ read_data = self.read(list(index.keys()), list(ffields.keys())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/modelsql.py", line 1194, in read getter_results = field.get( ^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/fields/function.py", line 27, in wrapper return func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/transaction.py", line 50, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/fields/function.py", line 168, in get return dict((name, call(name)) for name in names) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/fields/function.py", line 168, in <genexpr> return dict((name, call(name)) for name in names) ^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/model/fields/function.py", line 134, in call return { ^ File "/tryton/tryton/trytond/trytond/model/fields/function.py", line 135, in <dictcomp> r.id: convert(method(r, name), name) for r in records} ^^^^^^^^^^^^^^^ File "/tryton/tryton/trytond/trytond/modules/sale/sale.py", line 1727, in get_from_location return party.customer_location.id ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'id' ```
issue