Adrielso vor 8 Jahren
Ursprung
Commit
c9cb3a4517

+ 0 - 0
__init__.py


BIN
__init__.pyc


+ 5 - 5
__openerp__.py

@@ -1,12 +1,12 @@
 # -*- coding ;utf-8 -*-
 {
-    'name': 'Partner History CRM And ACCOUNT',
+    'name': 'Partner History ',
     'author':  'Adrielso Kunert',
     'version': '8.0.1.1.0',
     'category': 'Sales',
-    'description': "Historial de cliente Iniciativas, oportunidad, llamadas telefónicas, reuniones, ventas y facturaciones",
-    'depends': [ 'sale','account','crm',],
-    'data': [ 'views/partner_view_sale.xml',
-    ],
+    'description':
+    "Genera un Historial de (Iniciativas/Oportunidades, Llamadas telefónicas, Reuniones, Ventas, Facturaciones, Pos y Productos)",
+    'depends': [ 'sale','account','crm','point_of_sale',],
+    'data': ['views/partner_view_sale.xml',],
     'installable': True,
 }

+ 2 - 0
models/__init__.py

@@ -1,2 +1,4 @@
 # -*- coding : utf-8 -*-
+
+from . import product_stock_line
 from . import res_partner

BIN
models/__init__.pyc


+ 28 - 0
models/product_stock_line.py

@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+from openerp import tools, models, api
+from openerp.osv import osv, fields
+
+class product_stock_line(osv.osv):
+
+    _name = "product.stock.line"
+    _description = "product.stock.line"
+    _auto = False
+    _columns = {
+		'product_id': fields.many2one('product.product','product'),
+        'product_qty': fields.float(string='Cantidad', readonly=True),
+        'partner_id' : fields.many2one('res.partner',string='Partner'),
+        }
+    _order = 'id asc'
+
+    def init(self, cr):
+		tools.sql.drop_view_if_exists(cr, 'product_stock_line')
+		cr.execute("""
+            CREATE OR REPLACE VIEW product_stock_line as (
+                SELECT row_number() over (ORDER BY po.partner_id)as id,
+	                   pol.product_id as product_id,
+	                   sum(pol.qty) as product_qty,
+	                   po.partner_id as partner_id
+                FROM pos_order_line pol
+                    inner join pos_order po on(po.id = pol.order_id)
+                GROUP BY pol.product_id, po.partner_id)
+		    """)

BIN
models/product_stock_line.pyc


BIN
models/product_stock_picking.pyc


+ 3 - 3
models/res_partner.py

@@ -5,6 +5,6 @@ from openerp import fields, models
 class res_partner(models.Model):
     _inherit = 'res.partner'
 
-    all_opportunity_ids = fields.One2many( 'crm.lead', 'partner_id', 'Leads and Opportunities', )
-    stock_picking_move_ids = fields.One2many( 'stock.move', 'partner_id', )
-    crm_claim_ids = fields.One2many( 'crm.claim', 'partner_id', ' Reclamación', )
+    all_opportunity_ids = fields.One2many( 'crm.lead', 'partner_id', 'Leads and Opportunities')
+    id_pos_order = fields.One2many( 'pos.order', 'partner_id', 'Pos Order')
+    product_stock_line = fields.One2many( 'product.stock.line', "partner_id", string='product_stock_line')

BIN
models/res_partner.pyc


+ 0 - 0
static/description/icon.png


+ 29 - 38
views/partner_view_sale.xml

@@ -7,38 +7,34 @@
             <field name="inherit_id" ref="base.view_partner_form"/>
             <field name="arch" type="xml">
                 <notebook>
-                    <page string="Hitorial">
+                    <page string="Historial">
                     <notebook>
-
                       <!--  Iniciativas y Oportunidades  -->
-                      <page string=" Iniciativas y Oportunidades ">
+                      <page string="Iniciativas/Oportunidades ">
                           <group col="1">
-                            <field name="all_opportunity_ids" readonly="1" nolabel='1'>
+                            <field name="all_opportunity_ids" readonly="1" nolabel='1' delete='false' create='false' editable='bottom'>
                             </field>
                           </group>
                       </page>
-
                       <!-- Llamadas telefónicas  -->
-                      <page string=" Llamadas telefónicas ">
+                      <page string="Llamadas telefónicas">
                           <group col="1">
-                            <field name="phonecall_ids" readonly="1" nolabel='1'>
+                            <field name="phonecall_ids" readonly="1" nolabel='1' delete='false' create='false'>
                             </field>
                           </group>
                       </page>
-
                       <!-- Reuniones  -->
-                      <page string=" Reuniones ">
+                      <page string="Reuniones">
                            <group col="1">
-                             <field name="meeting_ids" readonly="1" nolabel='1'>
+                             <field name="meeting_ids" readonly="1" nolabel='1' delete='false' create='false'>
                              </field>
                            </group>
                       </page>
-
                       <!--ventas-->
                       <page string="Ventas">
                         <group col="1">
                             <field name="sale_order_ids" readonly="1" nolabel='1'>
-                                <tree>
+                                <tree delete='false' create='false' editable='bottom'>
                                     <field name="name"/>
                                     <field name="date_order"/>
                                     <field name="user_id"/>
@@ -48,12 +44,11 @@
                             </field>
                         </group>
                         </page>
-
                         <!-- Facturacion -->
                         <page string="Facturaciones">
                           <group col="1">
-                              <field name="invoice_ids" readonly="1" nolabel='1'>
-                                  <tree>
+                              <field name="invoice_ids" readonly="1" nolabel='1' >
+                                  <tree delete='false' create='false' editable='bottom'>
                                     <field name="number"/>
                                     <field name="date_invoice"/>
                                     <field name="user_id"/>
@@ -65,34 +60,30 @@
                               </field>
                           </group>
                           </page>
-
-                          <!-- orden de entrega -->
-                          <page string="Productos">
+                          <!-- pos.order -->
+                          <page string="Pos">
                             <group col="1">
-                                <field name="stock_picking_move_ids" readonly="1" nolabel='1'
-                                      context="{'stock_picking_move_ids.picking_type_id.id':2}" >
-                                  <tree>
-                                      <field name="name" />
-                                      <field name="product_qty" sum="Total"/>
-                                      <field name="picking_type_id"/>
-                                      <field name="state"/>
-                                 </tree>
+                                <field name="id_pos_order" readonly="1" nolabel='1' editable='bottom'>
+                                  <tree delete='false' create='false'>
+                                    <field name='name'/>
+                                    <field name='pos_reference'/>
+                                    <field name='date_order'/>
+                                    <field name='user_id'/>
+                                    <field name='amount_total' sum='total'/>
+                                    <field name='state'/>
+                                    <field name='session_id'/>
+                                  </tree>
                                 </field>
                             </group>
                           </page>
-
-                          <!-- Reclamación -->
-                          <page string="Reclamaciones">
+                          <!--  pos.order.line -->
+                          <page string="Productos">
                             <group col="1">
-                                <field name="crm_claim_ids"   readonly="1" nolabel='1'>
-                                  <tree>
-                                    <field name='name'/>
-                                    <field name='description'/>
-                                    <field name='user_fault'/>
-                                    <field name='categ_id'/>
-                                    <field name='priority'/>
-                                    <field name='stage_id'/>
-                                  </tree>
+                                <field name="product_stock_line" readonly="1" nolabel='1' >
+                                  <tree editable='bottom' delete='false' create='false'>
+                                      <field name='product_id' string="Productos"/>
+                                      <field name='product_qty' string="Cantidad" sum='qty'/>
+                                      </tree>
                                 </field>
                             </group>
                           </page>