Browse Source

[REF] b_purchase_manual_date_planned : blacken everything

pull/127/head
Elouan Le Bars 5 years ago
parent
commit
029dd0404f
  1. 2
      beesdoo_purchase_manual_date_planned/__init__.py
  2. 20
      beesdoo_purchase_manual_date_planned/__openerp__.py
  3. 15
      beesdoo_purchase_manual_date_planned/models/purchase.py
  4. 2
      beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml

2
beesdoo_purchase_manual_date_planned/__init__.py

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
import models
import models

20
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': [],
}
}

15
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()

2
beesdoo_purchase_manual_date_planned/report/report_purchaseorder.xml

@ -5,7 +5,7 @@
<div t-if="o.date_order" position="after">
<div class="col-xs-3">
<strong>Date Planned:</strong>
<strong>Date Planned :</strong>
<div t-field="o.manual_date_planned" />
</div>

Loading…
Cancel
Save