diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py
index 4e715179..fdf5cf87 100644
--- a/ext/custom-addons/dp_custom/models/account.py
+++ b/ext/custom-addons/dp_custom/models/account.py
@@ -37,3 +37,24 @@ class AccountPaymentTerm(models.Model):
_inherit = 'account.payment.term'
code = fields.Char(string='Code')
+
+
+class AccountInvoice(models.Model):
+ _inherit = 'account.invoice'
+
+ positions = fields.Integer(string='Positionen', compute='_compute_positions')
+ num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items')
+
+ @api.multi
+ def _compute_positions(self):
+ for record in self:
+ record.positions = len(record.invoice_line_ids)
+
+ @api.multi
+ def _compute_num_items(self):
+ for record in self:
+ num_items = 0
+ for line in record.invoice_line_ids:
+ if line.uom_id == self.env.ref('product.product_uom_unit'): # wenn die Mengeneinheit Stk. ist
+ num_items += line.quantity
+ record.num_items = num_items
diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py
index e1781312..3b0cc7c4 100644
--- a/ext/custom-addons/dp_custom/models/sale.py
+++ b/ext/custom-addons/dp_custom/models/sale.py
@@ -43,6 +43,22 @@ class SaleOrder(models.Model):
internal_notes = fields.Text()
assembly_notes = fields.Text()
earliest_scheduled_date = fields.Datetime(compute='_compute_earliest_scheduled_date')
+ positions = fields.Integer(string='Positionen', compute='_compute_positions')
+ num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items')
+
+ @api.multi
+ def _compute_positions(self):
+ for record in self:
+ record.positions = len(record.order_line)
+
+ @api.multi
+ def _compute_num_items(self):
+ for record in self:
+ num_items = 0
+ for line in record.order_line:
+ if line.product_uom == self.env.ref('product.product_uom_unit'): # wenn die Mengeneinheit Stk. ist
+ num_items += line.product_uom_qty
+ record.num_items = num_items
@api.multi
def _compute_earliest_scheduled_date(self):
diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml
index 3b77ac1d..553cf7f4 100644
--- a/ext/custom-addons/dp_reports_account/reports/invoice.xml
+++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml
@@ -7,7 +7,9 @@
| Pos | -Art-Nr. | -Bezeichnung | -Menge | +Pos. | +Anzahl | +Gewicht | Einzelpreis | +Artikel | Rabatt | Gesamtpreis |
|---|---|---|---|---|---|---|---|---|---|---|
| - - | -- - | -- - | -- - | -- - | -- - | -- - | -||||
| + + | ++ + | ++ + | ++ + | +
+ + + + |
+ + + | ++ + | +||||
|
+ |
+ ||||||||||
-
-
-
+ Lieferkonditionen:
+
+
+
+
+
| Pos. | -Art-Nr. | -Bezeichnung | -Menge | +Anzahl | +Gewicht | Einzelpreis | +Artikel | Rabatt | Gesamtpreis | - | - - | -
-
- - - Zolltarif Nr.: - - - |
- + | - | + | + + | ++ |
+ + + + |
+
@@ -147,7 +160,7 @@ |
|---|---|---|---|---|---|---|---|---|---|
| + |
|
@@ -199,9 +212,8 @@
||||||||