From d70ec3028a7f5c21062841d1adaa9988bd15f682 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Tue, 9 Oct 2018 13:02:46 +0200 Subject: [PATCH] new functionality "Flash" change report layout for Lieferschein --- ext/custom-addons/dp_custom/models/res_partner.py | 3 ++- ext/custom-addons/dp_custom/models/sale.py | 15 +++++++++++++++ .../dp_custom/views/res_partner_views.xml | 3 +++ ext/custom-addons/dp_custom/views/sale_views.xml | 4 ++++ .../dp_reports_stock/reports/stock.xml | 15 +++++++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/ext/custom-addons/dp_custom/models/res_partner.py b/ext/custom-addons/dp_custom/models/res_partner.py index e9a99530..119f6269 100644 --- a/ext/custom-addons/dp_custom/models/res_partner.py +++ b/ext/custom-addons/dp_custom/models/res_partner.py @@ -67,6 +67,7 @@ class Partner(models.Model): collective_bill = fields.Boolean(string='Sammelrechnung', default=True) country_id = fields.Many2one('res.country', string='Country', ondelete='restrict', default=_default_country_id) commission_account_ids = fields.Many2many(comodel_name='commission.account', string='Provisionsempfänger') + partner_flash = fields.Char() _sql_constraints = [ ('ref_uniq', 'unique(ref)', 'Die Interne Referenz muss eindeutig sein'), @@ -281,7 +282,7 @@ class Partner(models.Model): common_list.extend( ['name', 'ref', 'partner_sector_id', 'info_uid', 'comment', 'vat', 'property_payment_term_id', 'date_vat_check', 'active', 'property_product_pricelist', 'retail_partner_id', - 'is_retailer', 'name2', 'carrier_id', 'collective_bill', 'fiscal_position']) + 'is_retailer', 'name2', 'carrier_id', 'collective_bill', 'fiscal_position', 'partner_flash']) return common_list elif self.env.context.get('sst_14', False): common_list = ['firstname', 'lastname', 'midname', 'email', 'company_odoo_id', 'portal_id', 'opt_out'] diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index d8932ca1..918e7ebb 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -65,6 +65,8 @@ class SaleOrder(models.Model): # pg9_call = fields.Char(string='PG9-Auftrag', compute='_pg9_call', store=False) pg9_call_D = fields.Char(string='PG9-Auftrag_D', compute='_pg9_call', store=False) pg9_call_T = fields.Char(string='PG9-Auftrag_T', compute='_pg9_call', store=False) + partner_flash = fields.Text(compute='_get_partner_flash', store=False) +# partner_flash = fields.Char(store=False) @api.multi def _reset_sequence(self): @@ -87,10 +89,16 @@ class SaleOrder(models.Model): # end def _pg9_call + @api.multi + def _get_partner_flash(self): + for record in self: + record.partner_flash = record.partner_id.partner_flash + @api.multi @api.onchange('partner_invoice_id') def _onchange_partner_invoice_id(self): for record in self: +# record.partner_flash = record.partner_id.partner_flash if record.partner_invoice_id.is_retailer: record.payment_term_id = record.partner_invoice_id.property_payment_term_id @@ -452,6 +460,9 @@ class SaleOrder(models.Model): @api.multi @api.onchange('partner_id') def onchange_partner_id(self): + # for record in self: + # record.partner_flash = record.partner_id.partner_flash + if not self.partner_id: self.update({ 'partner_invoice_id': False, @@ -472,6 +483,10 @@ class SaleOrder(models.Model): if self.partner_id.team_id: values['team_id'] = self.partner_id.team_id.id + + if self.partner_id: + values['partner_flash'] = self.partner_id.partner_flash + self.update(values) @api.multi diff --git a/ext/custom-addons/dp_custom/views/res_partner_views.xml b/ext/custom-addons/dp_custom/views/res_partner_views.xml index 971457b9..19448302 100644 --- a/ext/custom-addons/dp_custom/views/res_partner_views.xml +++ b/ext/custom-addons/dp_custom/views/res_partner_views.xml @@ -31,6 +31,9 @@ + + +
diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 006131c6..1d3433ab 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -12,6 +12,10 @@ attrs="{'invisible':['|','|',('state','!=','draft'),('order_type','!=','T'),('assembly_state','not in',[False,'import_failed'])]}"/> + + +
+ diff --git a/ext/custom-addons/dp_reports_stock/reports/stock.xml b/ext/custom-addons/dp_reports_stock/reports/stock.xml index 21ac8dc5..374b070a 100644 --- a/ext/custom-addons/dp_reports_stock/reports/stock.xml +++ b/ext/custom-addons/dp_reports_stock/reports/stock.xml @@ -24,6 +24,11 @@
+
+
+ Tel: + +
@@ -41,6 +46,11 @@
+
+
+ Tel: + +
@@ -101,6 +111,7 @@ + + + +