Browse Source

Merge remote-tracking branch 'origin/9.0-S0024-jeanmarc' into 9.0-s0024-elise

pull/14/head
EliseDup 8 years ago
parent
commit
5dfcb3679e
  1. 2
      beesdoo_inventory/__init__.py
  2. 31
      beesdoo_inventory/__openerp__.py
  3. 2
      beesdoo_inventory/models/__init__.py
  4. 29
      beesdoo_inventory/models/stock.py
  5. 29
      beesdoo_inventory/views/stock.xml

2
beesdoo_inventory/__init__.py

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

31
beesdoo_inventory/__openerp__.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
{
'name': "beesdoo_inventory",
'summary': """
Modification of inventory data for the needs of beescoop
- SOO24 - Bon de livraison""",
'description': """
""",
'author': "Beescoop - Cellule IT",
'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': 'Sales Management',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['delivery'],
# always loaded
'data': [
'views/stock.xml' ],
# only loaded in demonstration mode
'demo': [],
}

2
beesdoo_inventory/models/__init__.py

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

29
beesdoo_inventory/models/stock.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
class StockPicking(models.Model):
_inherit = 'stock.picking'
max_shipping_date = fields.Datetime("End Shipping Date")
responsible = fields.Many2one("res.partner", string="Responsible Person")
def _add_follower(self):
self.env['mail.followers'].create({'partner_id': self.responsible.id,
'res_id': self.id,
'res_model': "stock.picking",})
@api.multi
def write(self, values):
res = super(StockPicking, self).write(values)
print "WRITE"
print values.get('responsible')
if values.get('responsible'):
for picking in self:
picking._add_follower()
return res
@api.model
def create(self, values):
picking = super(StockPicking, self).create(values)
picking._add_follower()
return picking

29
beesdoo_inventory/views/stock.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="beesdoo_stock_tree_view">
<field name="name">beesdoo.stock.tree.view</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.vpicktree" />
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="responsible" />
</field>
</field>
</record>
<record model="ir.ui.view" id="beesdoo_stock_form_view">
<field name="name">beesdoo.stock.form.view</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="min_date" position="after">
<field name="max_shipping_date" placeholder="Max shipping date" />
</field>
<field name="backorder_id" position="after">
<field name="responsible" />
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save