Skip to content

Model names not completing. #11

@gaya-lmn

Description

@gaya-lmn

I'm not sure if this is a feature that is implemented or not but currently the model names like:

def _compute_stock_info(self):
        for rec in self:
            if rec.location_id:
                quants = self.env['stock.quant'].search([('location_id', '=', rec.location_id.id), ('quantity', '>', 0)])
                if quants:
                    rec.total_quantity = sum(quants.mapped('quantity'))
                    rec.product_id = quants[0].product_id.id
                else:
                    rec.total_quantity = 0.0
                    rec.product_id = False
            else:
                rec.total_quantity = 0.0
                rec.product_id = False

typin self.env['stock.qu does not complete the model.

currently using Odoo zed extension v1.0.4 with Odoo 18.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions