---
# System prepended metadata

title: REVISION DE ETIQUETAS
tags: [DataBase]

---

# REVISION DE ETIQUETAS

###### tags: `DataBase`

:::danger
El problema surge una vez que el usuario en produccion reporta que no puede imprimir los datos de parthner 
:::

- [ ] Validar que el producto tenga coneccion con **category_parthner_id** 
- [ ] Validar que el **res_parthner** sea **NULL**
- [ ] Asignar ID de **category_parthner_id** en el **product_category**
- [ ] Verificar que la etiqueta se puede Imprimir con el nombre y determinante del cliente

```sql=
select * from res_partner;

SELECT  * from product_category;


SELECT * from product_product
inner join product_template on product_product.product_tmpl_id = product_template.id
inner join res_partner rp on
where  product_product.default_code = 'P10097';

select * from mrp_production mp where product_id=88724;


select  * from product_product pp where default_code = 'P10097';
select  * from product_template pt where default_code = 'P10097'; /** 10988 **/


select * from res_partner where name like 'IDEMITSU%' ;--and  parent_id is null;
select category_partner_id from product_category pc where id = 10988;

update product_category set category_partner_id = 94632 where id = 10988;
```

```php=
@api.multi
def get_partner(self):
    obj_rp = self.env['res.partner']
    obj_id_cat = self.env['product.category']
    if self.product_id:
        res_ct = obj_id_cat.search([('id', '=', self[0].product_id.categ_id.id)])
        if res_ct:
            res_rp = obj_rp.search([('id', '=', res_ct[0].category_partner_id.id)])
            if res_rp:
                comment = res_rp[0].comment
                return comment
            else:
                comment = '\*SIN DATOS DE CLIENTE'
                return comment
    return False
  ***/