From 029dd0404f2211787d0ca24c470f61106d103d1f Mon Sep 17 00:00:00 2001 From: Elouan Le Bars Date: Wed, 22 Jan 2020 12:40:16 +0100 Subject: [PATCH] [REF] b_purchase_manual_date_planned : blacken everything --- .../__init__.py | 2 +- .../__openerp__.py | 20 +++++++------------ .../models/purchase.py | 15 +++++++++----- .../report/report_purchaseorder.xml | 2 +- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/beesdoo_purchase_manual_date_planned/__init__.py b/beesdoo_purchase_manual_date_planned/__init__.py index 0f7cb6b..89d26e2 100644 --- a/beesdoo_purchase_manual_date_planned/__init__.py +++ b/beesdoo_purchase_manual_date_planned/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -import models \ No newline at end of file +import models diff --git a/beesdoo_purchase_manual_date_planned/__openerp__.py b/beesdoo_purchase_manual_date_planned/__openerp__.py index db3a678..d5c133c 100644 --- a/beesdoo_purchase_manual_date_planned/__openerp__.py +++ b/beesdoo_purchase_manual_date_planned/__openerp__.py @@ -1,31 +1,25 @@ # -*- coding: utf-8 -*- { - 'name': "Bees Purchase Manual date planned", + 'name': "Beescoop Purchase - Manual date planned", 'summary': """ - Extension du module Purchase to set manually the date planned for the whole purchase.order""", + Extension of module Purchase to manually set the planned date for the whole purchase.order + """, 'description': """ - Long description of module's purpose + """, - 'author': "Beescoop - Cellule IT", + 'author': "Beescoop - Cellule IT, Elouan Le Bars", 'website': "https://github.com/beescoop/Obeesdoo", - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml - # for the full list 'category': 'Purchase', - 'version': '0.1', + 'version': '9.0.1.0.1', - # any module necessary for this one to work correctly 'depends': ['purchase'], - # always loaded 'data': [ 'views/purchase_order.xml', 'report/report_purchaseorder.xml', ], - # only loaded in demonstration mode - 'demo': [], -} \ No newline at end of file +} diff --git a/beesdoo_purchase_manual_date_planned/models/purchase.py b/beesdoo_purchase_manual_date_planned/models/purchase.py index 45a386d..a438e0f 100644 --- a/beesdoo_purchase_manual_date_planned/models/purchase.py +++ b/beesdoo_purchase_manual_date_planned/models/purchase.py @@ -1,12 +1,15 @@ # -*- coding: utf-8 -*- from openerp import models, api, fields + class PurchaseOrder(models.Model): - _inherit = 'purchase.order' + _inherit = "purchase.order" - manual_date_planned = fields.Datetime(string='Scheduled Date', required=True) + manual_date_planned = fields.Datetime( + string="Scheduled Date", required=True + ) - @api.onchange('order_line', 'order_line.date_planned') + @api.onchange("order_line", "order_line.date_planned") def _on_change_manual_date_planned(self): """ Since we don't see the date planned on the line anymore @@ -15,7 +18,7 @@ class PurchaseOrder(models.Model): for line in self.order_line: if line.date_planned and not self.manual_date_planned: self.manual_date_planned = line.date_planned - break; + break @api.multi def button_confirm(self): @@ -24,5 +27,7 @@ class PurchaseOrder(models.Model): hide them, we call the method to set the date planned on the line at the confirmation """ self.ensure_one() - self.with_context(date_planned=self.manual_date_planned).action_set_date_planned() + self.with_context( + date_planned=self.manual_date_planned + ).action_set_date_planned() return super(PurchaseOrder, self).button_confirm() diff --git a/beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml b/beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml index d820c8b..13ffe1c 100644 --- a/beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml +++ b/beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml @@ -5,7 +5,7 @@
- Date Planned: + Date Planned :