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 @@
-
+
+ Kundendaten +
@@ -18,42 +20,68 @@
+
+ Email: + +
+ Telefon: +
-
-
-
-
+
+ Lieferadresse +
+ + + +
+ +
+ + +
+ +
+
+
Kundennr.:
-
+
Ihre UID:
-
+
Ihre Referenz:
-
+
Referenzbeleg:
-
+
Rechnungsdatum:
-
+
Ansprechpartner:
-
+
Email:
-
+
Telefon:
+
+ Positionen: + +
+
+ Artikel: + +
@@ -74,16 +102,14 @@
- - - - - + + + + @@ -91,30 +117,50 @@ - - - - - - - - - - + + + + + + + + + + + + + + + +
PosArt-Nr.BezeichnungMengePos.AnzahlGewicht EinzelpreisArtikel Rabatt Gesamtpreis
- - - - - - - - - - - - - -
+ + + + + + + + + + + + +
+
+ + Zolltarif Nr.: + + +
+ +
+ + + +
+ +
@@ -156,11 +202,14 @@

-

- - -
-
+

+ Lieferkonditionen: + +
+

+

+ +

diff --git a/ext/custom-addons/dp_reports_sale/reports/sale.xml b/ext/custom-addons/dp_reports_sale/reports/sale.xml index 43cda36d..1eefc9f5 100644 --- a/ext/custom-addons/dp_reports_sale/reports/sale.xml +++ b/ext/custom-addons/dp_reports_sale/reports/sale.xml @@ -7,8 +7,8 @@
-
- Kundendaten +
+ Kundendaten
@@ -27,8 +27,8 @@ Telefon:
-
- Lieferadresse +
+ Lieferadresse
@@ -41,51 +41,59 @@
-
-
+
+
Kundennr.:
-
+
Ihre UID:
-
+
Ihre Referenz:
-
+
Angebotsdatum:
-
+
Lieferdatum:
-
+
Gültig bis:
-
+
Bestelldatum:
-
+
Ansprechpartner:
-
+
Email:
-
+
Telefon:
+
+ Positionen: + +
+
+ Artikel: + +
@@ -94,22 +102,20 @@

Auftragsbestätigung Angebot - +

- - - - + + + @@ -122,23 +128,30 @@ - - - - + + + @@ -147,7 +160,7 @@ - @@ -199,9 +212,8 @@

-

- Zahlungskonditionen: - +

+

Pos.Art-Nr.BezeichnungMengeAnzahlGewicht EinzelpreisArtikel Rabatt Gesamtpreis
- - - -
-

- Zolltarif Nr.: - -

-
+ + + + + + + + +
+
+ + Zolltarif Nr.: + + +
+ +
+