Make description on purchase request optional

issue6860
review39911002
This commit is contained in:
Cédric Krier committed 2017-12-18 19:03:48 +01:00
1 parent 333c02891e
commit 63ef281c67
4 files changed
+38 -40

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Make description on purchase request optional
* Warns when the warehouse of a purchase differs from its purchase requests
Version 4.6.0 - 2017-10-30
+1 -7
View File
@@ -31,11 +31,7 @@ class PurchaseRequest(ModelSQL, ModelView):
product = fields.Many2One('product.product', 'Product',
select=True, readonly=True, domain=[('purchasable', '=', True)])
description = fields.Text('Description', readonly=True,
states={
'required': ~Eval('product'),
'readonly': STATES['readonly'],
},
depends=['product'] + DEPENDS)
states=STATES, depends=DEPENDS)
party = fields.Many2One('party.party', 'Party', select=True, states=STATES,
depends=DEPENDS)
quantity = fields.Float('Quantity', required=True, states=STATES,
@@ -449,8 +445,6 @@ class CreatePurchase(Wizard):
Decimal(1) / 10 ** Line.unit_price.digits[1])
for f, v in key:
setattr(line, f, v)
if not line.description:
line.description = line.product.name
line.quantity = sum(r.quantity for r in requests)
line.purchase = purchase
line.on_change_product()
+36 -32
View File
@@ -2,38 +2,42 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<separator string="Product Info" colspan="4" id="product"/>
<label name="product"/>
<field name="product"/>
<newline/>
<label name="description"/>
<field name="description" colspan="3" yexpand="0"/>
<label name="quantity"/>
<field name="quantity"/>
<label name="uom"/>
<field name="uom"/>
<label name="computed_quantity"/>
<field name="computed_quantity"/>
<label name="computed_uom"/>
<field name="computed_uom"/>
<separator string="Supply Info" colspan="4" id="supply"/>
<label name="party"/>
<field name="party"/>
<newline/>
<label name="warehouse"/>
<field name="warehouse"/>
<label name="company"/>
<field name="company"/>
<label name="purchase_date"/>
<field name="purchase_date"/>
<label name="supply_date"/>
<field name="supply_date"/>
<label name="purchase"/>
<field name="purchase"/>
<label name="stock_level"/>
<field name="stock_level"/>
<label name="origin"/>
<field name="origin"/>
<notebook colspan="4">
<page string="Product Info" id="product">
<label name="product"/>
<field name="product"/>
<newline/>
<label name="quantity"/>
<field name="quantity"/>
<label name="uom"/>
<field name="uom"/>
<label name="computed_quantity"/>
<field name="computed_quantity"/>
<label name="computed_uom"/>
<field name="computed_uom"/>
<separator name="description" colspan="4"/>
<field name="description" colspan="4"/>
</page>
<page string="Supply Info" id="supply">
<label name="party"/>
<field name="party"/>
<newline/>
<label name="warehouse"/>
<field name="warehouse"/>
<label name="company"/>
<field name="company"/>
<label name="purchase_date"/>
<field name="purchase_date"/>
<label name="supply_date"/>
<field name="supply_date"/>
<label name="purchase"/>
<field name="purchase"/>
<label name="stock_level"/>
<field name="stock_level"/>
<label name="origin"/>
<field name="origin"/>
</page>
</notebook>
<label name="state"/>
<field name="state"/>
<group col="-1" colspan="2" id="buttons">
-1
View File
@@ -3,7 +3,6 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="product"/>
<field name="description"/>
<field name="quantity"/>
<field name="uom"/>
<field name="warehouse"/>