Fall 5557: US02
parent
e1253caf51
commit
5dded76140
|
|
@ -28,6 +28,7 @@ class AccountInvoiceLine(models.Model):
|
||||||
intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code')
|
intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code')
|
||||||
lot_id = fields.Many2one(comodel_name='stock.production.lot', string='Lot')
|
lot_id = fields.Many2one(comodel_name='stock.production.lot', string='Lot')
|
||||||
weight = fields.Float(string='Gewicht', compute='_compute_weight')
|
weight = fields.Float(string='Gewicht', compute='_compute_weight')
|
||||||
|
hide_intrastat_code = fields.Boolean('ZV', help='Zolltarifnummer verbergen')
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
|
|
@ -131,7 +132,7 @@ class AccountInvoice(models.Model):
|
||||||
intrastrat_not_set = False
|
intrastrat_not_set = False
|
||||||
for invoice_line in self.invoice_line_ids:
|
for invoice_line in self.invoice_line_ids:
|
||||||
if invoice_line.product_id and invoice_line.product_id.type != 'service':
|
if invoice_line.product_id and invoice_line.product_id.type != 'service':
|
||||||
if not invoice_line.intrastat_id:
|
if not invoice_line.intrastat_id and not invoice_line.hide_intrastat_code:
|
||||||
info += invoice_line.name + "\n"
|
info += invoice_line.name + "\n"
|
||||||
intrastrat_not_set = True
|
intrastrat_not_set = True
|
||||||
if intrastrat_not_set:
|
if intrastrat_not_set:
|
||||||
|
|
|
||||||
|
|
@ -503,6 +503,7 @@ class SaleOrderLine(models.Model):
|
||||||
'price_unit': -invoice_lines.price_subtotal * (discount / 100),
|
'price_unit': -invoice_lines.price_subtotal * (discount / 100),
|
||||||
'uom_id': self.env.ref('product.product_uom_unit').id,
|
'uom_id': self.env.ref('product.product_uom_unit').id,
|
||||||
'name': 'Händlerrabatt {}%'.format(discount),
|
'name': 'Händlerrabatt {}%'.format(discount),
|
||||||
|
'hide_intrastat_code': True
|
||||||
})
|
})
|
||||||
del vals['discount']
|
del vals['discount']
|
||||||
invoice_lines |= self.env['account.invoice.line'].create(vals)
|
invoice_lines |= self.env['account.invoice.line'].create(vals)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@
|
||||||
<xpath expr="//field[@name='invoice_line_ids']/kanban//field[@name='product_id']" position="after">
|
<xpath expr="//field[@name='invoice_line_ids']/kanban//field[@name='product_id']" position="after">
|
||||||
<field name="lot_id"/>
|
<field name="lot_id"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='invoice_line_ids']/tree//field[@name='invoice_line_tax_ids']" position="before">
|
||||||
|
<field name="hide_intrastat_code"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@
|
||||||
</strong>
|
</strong>
|
||||||
<br/>
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
<span t-if="with_intrastat and invoice_line.intrastat_id">
|
<span t-if="with_intrastat and invoice_line.intrastat_id and not invoice_line.hide_intrastat_code">
|
||||||
<strong>Zolltarif Nr.:</strong>
|
<strong>Zolltarif Nr.:</strong>
|
||||||
<span t-field="invoice_line.intrastat_id"/>
|
<span t-field="invoice_line.intrastat_id"/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class AccountInvoiceLine(models.Model):
|
||||||
compute='_compute_price_reduce', required=True, store=True,
|
compute='_compute_price_reduce', required=True, store=True,
|
||||||
help='Rabattierter Einzelpreis, inkludiert bereits den Rabatt und ist auf 2 Stellen '
|
help='Rabattierter Einzelpreis, inkludiert bereits den Rabatt und ist auf 2 Stellen '
|
||||||
'kaufmännisch gerundet.')
|
'kaufmännisch gerundet.')
|
||||||
hide_discount = fields.Boolean(string='RV')
|
hide_discount = fields.Boolean(string='RV', help='Rabatt verbergen')
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('price_unit', 'discount')
|
@api.depends('price_unit', 'discount')
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ from odoo.tools import float_round
|
||||||
class SaleOrderLine(models.Model):
|
class SaleOrderLine(models.Model):
|
||||||
_inherit = 'sale.order.line'
|
_inherit = 'sale.order.line'
|
||||||
|
|
||||||
hide_discount = fields.Boolean(string='RV')
|
hide_discount = fields.Boolean(string='RV', help='Rabatt verbergen')
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id')
|
@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue