Browse Source

S001

pull/114/head
EliseDup 8 years ago
committed by Rémy Taymans
parent
commit
8887cf6b71
  1. 2
      beesdoo_purchase/__init__.py
  2. 31
      beesdoo_purchase/__openerp__.py
  3. 3
      beesdoo_purchase/models/__init__.py
  4. 17
      beesdoo_purchase/models/purchase_order.py
  5. 1
      beesdoo_purchase/security/ir.model.access.csv
  6. 14
      beesdoo_purchase/views/purchase_order.xml

2
beesdoo_purchase/__init__.py

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

31
beesdoo_purchase/__openerp__.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
{
'name': "Bees Purchase",
'summary': """
Extension du module Purchase""",
'description': """
Long description of module's purpose
""",
'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': 'Purchase',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base','purchase','beesdoo_product'],
# always loaded
'data': [
'views/purchase_order.xml',
'security/ir.model.access.csv',
],
# only loaded in demonstration mode
'demo': [],
}

3
beesdoo_purchase/models/__init__.py

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
import purchase_order

17
beesdoo_purchase/models/purchase_order.py

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
class PurchaseOrderLine(models.Model):
_inherit = 'purchase.order.line'
product_id = fields.Many2one('product.product', string='Product',
domain=['&',('purchase_ok', '=', True),('template.main_seller_id','=','order_id.partner_id')], change_default=True, required=True)
@api.onchange('order_id')
def _onchange_order_id(self):
print "changed", self.order_id, self.order_id.partner_id

1
beesdoo_purchase/security/ir.model.access.csv

@ -0,0 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

14
beesdoo_purchase/views/purchase_order.xml

@ -0,0 +1,14 @@
<openerp>
<data>
<!-- <record model="ir.ui.view" id="beesdoo_purchase_order_form_view">
<field name="name">beesdoo.purchase.order.form.view</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
</field>
</record>
-->
</data>
</openerp>
Loading…
Cancel
Save