Materialtyp: new flag 'production_relevant'; Product_view: 3 new groupings (type,categ_id,material_type_id)
parent
3084e105fd
commit
8a0d32434e
|
|
@ -30,6 +30,7 @@ class MaterialType(models.Model):
|
|||
print_default_code = fields.Boolean(string='Drucke Artikelnummer', required=True, help='Definiert, ob die Artikelnummer gedruckt wird')
|
||||
print_sales_pic = fields.Boolean(string='Drucke Artikelbild', default=True, required=False, help='Definiert, ob ein Artikelbild gedruckt wird (Angebot/Auftrag)')
|
||||
print_production_pic = fields.Boolean(string='Drucke Produktionsbild', default=False, required=False, help='Definiert, ob ein Produktionsbild gedruckt wird (Produktionsauftrag)')
|
||||
production_relevant = fields.Boolean(string='Drucke auf Produktionsschein', default=True, required=False, help='Definiert, ob ein Artikel mit diesem Materiatyp am Produktionsschein angedruckt wird. (Produktionsauftrag)')
|
||||
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique(name)', 'Die Bezeichnung muss eindeutig sein')
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class SaleOrder(models.Model):
|
|||
assembly_notes = fields.Text()
|
||||
earliest_scheduled_date = fields.Datetime(compute='_compute_earliest_scheduled_date')
|
||||
positions = fields.Integer(string='Positionen', compute='_compute_positions')
|
||||
production_positions = fields.Integer(string='Positionen', compute='_compute_positions', store=False)
|
||||
num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items')
|
||||
weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total')
|
||||
confirmation_nr = fields.Char('Freigabenummer')
|
||||
|
|
@ -113,7 +114,14 @@ class SaleOrder(models.Model):
|
|||
@api.multi
|
||||
def _compute_positions(self):
|
||||
for record in self:
|
||||
record.positions = len(record.order_line)
|
||||
p = 0
|
||||
pp = 0
|
||||
for line in record.order_line:
|
||||
p += 1
|
||||
if line.product_id.material_type_id.production_relevant:
|
||||
pp += 1
|
||||
record.positions = p
|
||||
record.production_positions = pp
|
||||
|
||||
@api.multi
|
||||
def _compute_num_items(self):
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<field name="print_default_code"/>
|
||||
<field name="print_sales_pic"/>
|
||||
<field name="print_production_pic"/>
|
||||
<field name="production_relevant"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
|
@ -25,6 +26,7 @@
|
|||
<field name="print_default_code"/>
|
||||
<field name="print_sales_pic"/>
|
||||
<field name="print_production_pic"/>
|
||||
<field name="production_relevant"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -110,4 +110,17 @@
|
|||
name="X-Kategorien"
|
||||
action="product_xcategory_action"/>
|
||||
|
||||
<record id="product_template_search_view_tz" model="ir.ui.view">
|
||||
<field name="name">product.template.search.tz</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='categ_id']" position="after">
|
||||
<filter string="Produktart" domain="[]" context="{'group_by':'type'}"/>
|
||||
<filter string="Interne Kategorie" domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
<filter string="Materialtyp" domain="[]" context="{'group_by':'material_type_id'}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
<strong>
|
||||
<span class="col-xs-2">Positionen:</span>
|
||||
</strong>
|
||||
<span class="col-xs-2" t-field="o.positions"/>
|
||||
<span class="col-xs-2" t-field="o.production_positions"/>
|
||||
</div>
|
||||
<div class="row height-20">
|
||||
<div class="col-xs-3" style="padding-right: 4px">
|
||||
|
|
@ -100,6 +100,7 @@
|
|||
<tbody class="sale-tbody">
|
||||
<t t-set="pos_nr" t-value="0"/>
|
||||
<t t-foreach="o.order_line" t-as="order_line">
|
||||
<t t-if="order_line.product_id.material_type_id.production_relevant">
|
||||
<tr>
|
||||
<t t-set="pos_nr" t-value="pos_nr+1"/>
|
||||
<td class="text-center">
|
||||
|
|
@ -113,7 +114,7 @@
|
|||
</strong>
|
||||
<br/>
|
||||
</t>
|
||||
<!--
|
||||
<!--
|
||||
<t t-if="order_line.intrastat_id">
|
||||
<span>
|
||||
<strong>Zolltarif Nr.:</strong>
|
||||
|
|
@ -121,9 +122,9 @@
|
|||
</span>
|
||||
<br/>
|
||||
</t>
|
||||
-->
|
||||
-->
|
||||
<span t-field="order_line.name"/>
|
||||
<!--
|
||||
<!--
|
||||
<t t-if="order_line.delivery_date and (order_line.delivery_date != o.delivery_date)">
|
||||
<br/>
|
||||
<strong>Voraussichtliches Lieferdatum:</strong>
|
||||
|
|
@ -132,7 +133,7 @@
|
|||
<p t-if="order_line.lot_id">
|
||||
<span t-esc="order_line.lot_id.name.split('.')[2]"/>
|
||||
</p>
|
||||
-->
|
||||
-->
|
||||
<p t-if="order_line.lot_id.notes">
|
||||
<span t-field="order_line.lot_id.notes"/>
|
||||
</p>
|
||||
|
|
@ -151,7 +152,7 @@
|
|||
kg
|
||||
</t>
|
||||
</td>
|
||||
<!--
|
||||
<!--
|
||||
<td rowspan="2" class="text-right">
|
||||
<span t-if="order_line.hide_discount"
|
||||
t-field="order_line.price_reduce"/>
|
||||
|
|
@ -168,7 +169,7 @@
|
|||
<td rowspan="2" class="text-right">
|
||||
<span t-field="order_line.price_subtotal"/>
|
||||
</td>
|
||||
-->
|
||||
-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="border: 0;text-align: center;">
|
||||
|
|
@ -179,6 +180,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue