Closed xewl closed 2 years ago
Count is currently only implemented via the ->model('res.user') interface. As seen in the test cases:
public function testCount()
{
$amount = $this->odoo
->model('res.partner')
->count();
$this->assertEquals('integer', gettype($amount));
}
public function testCountWhere()
{
$amount = $this->odoo
->model('res.partner')
->count();
$customerAmount = $this->odoo
->model('res.partner')
->where('is_company', '=', true)
->count();
$this->assertLessThan($amount, $customerAmount);
}
I will add the test for it asap, as I will be continuing on using this library in the following 2 weeks.
In one of my 2 use cases; I'm currently not using the model() (RequestBuilder) interface, as I'm building the Domain
I needed for it myself. That's where I hit this use case.
Keep you posted :)
fyi, I reckon I've been postponing this, but I'll continue on this asap :)
Obuchmann\OdooJsonRpc\Odoo
seems to be missing a way to get the count of a search result.While
Odoo->search
usesOdoo\Endpoint->search
, there's currently no alternative to reachOdoo\Endpoint->count
from theOdoo
provider.