Require warehouse on quotation for kit product

issue10693
review346971002
This commit is contained in:
David Blanco Bautista committed 2021-10-02 15:36:39 +02:00
1 parent ca42e85c6d
commit e78f2ac802
1 file changed
+7 -1
+7 -1
View File
@@ -741,7 +741,7 @@ class Sale(
location = line.to_location
if ((not location or not line.warehouse)
and line.product
and line.product.type in ('goods', 'assets')):
and line.product.type in line.get_move_product_types()):
raise SaleQuotationError(
gettext('sale.msg_sale_warehouse_required_for_quotation',
sale=self.rec_name))
@@ -1164,6 +1164,12 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
fields.Many2One('company.company', "Company"),
'on_change_with_company')
@classmethod
def get_move_product_types(cls):
pool = Pool()
Move = pool.get('stock.move')
return Move.get_product_types()
@classmethod
def __setup__(cls):
super().__setup__()