如何使用 PHP 在特定日期之间动态地从 openerp 获取订单?
How to get get order from openerp between a specific date dynamically using PHP?
实际上,我需要帮助才能从 openerp 获取销售订单,我正在获取记录,但问题是当我登录到 openerp 并转到销售订单并检查某个特定日期的记录时,它显示我在网站上有 22 条记录。
同时,我们在脚本中放置的用于获取销售订单的逻辑在同一日期仅获取 3 条记录。
We have put logic as below:-
1. We are making connection and getting res.partner id's using below code
$ids = $models->execute_kw($db, $uid, $password,
'res.partner', 'search',
array(array(array('is_company', '=', true),
array('customer', '=', true)
))
);
2. After that I am getting all partner id's for the specific date via below given code
$partner_ids = $models->execute_kw($db, $uid, $password,
'sale.order', 'search',array(array(array('partner_id', '=', $ids),array('create_date', '>=', '2018-04-17 00:00:00'),array('create_date', '<=', '2018-04-17 23:59:59')))
);
3. After that I am getting all sales record from the below given code
$saledata=$models->execute_kw($db, $uid, $password,
'sale.order', 'read',
array($partner_ids)
);
上面的代码只给我很少的订单,但网站上有很多订单。
当我从我的第一个请求中删除 array('is_company', '=', true) 时,它会为同一日期提供 115 条记录。
请告诉我方式,以便我可以获取网站上显示的所有销售订单
同意@CZoellner 的观点,关注他的评论和这些答案。
您似乎在尝试搜索带日期的销售订单。所以技术领域名称是 "date_order".
将create_date条件替换为date_order
您还需要注意以下事项:
- 销售订单状态,
- 具体公司记录,
- 如果不寻找特定客户,则删除 partner_ids 条件
实际上,我需要帮助才能从 openerp 获取销售订单,我正在获取记录,但问题是当我登录到 openerp 并转到销售订单并检查某个特定日期的记录时,它显示我在网站上有 22 条记录。
同时,我们在脚本中放置的用于获取销售订单的逻辑在同一日期仅获取 3 条记录。
We have put logic as below:-
1. We are making connection and getting res.partner id's using below code
$ids = $models->execute_kw($db, $uid, $password,
'res.partner', 'search',
array(array(array('is_company', '=', true),
array('customer', '=', true)
))
);
2. After that I am getting all partner id's for the specific date via below given code
$partner_ids = $models->execute_kw($db, $uid, $password,
'sale.order', 'search',array(array(array('partner_id', '=', $ids),array('create_date', '>=', '2018-04-17 00:00:00'),array('create_date', '<=', '2018-04-17 23:59:59')))
);
3. After that I am getting all sales record from the below given code
$saledata=$models->execute_kw($db, $uid, $password,
'sale.order', 'read',
array($partner_ids)
);
上面的代码只给我很少的订单,但网站上有很多订单。
当我从我的第一个请求中删除 array('is_company', '=', true) 时,它会为同一日期提供 115 条记录。
请告诉我方式,以便我可以获取网站上显示的所有销售订单
同意@CZoellner 的观点,关注他的评论和这些答案。
您似乎在尝试搜索带日期的销售订单。所以技术领域名称是 "date_order".
将create_date条件替换为date_order
您还需要注意以下事项:
- 销售订单状态,
- 具体公司记录,
- 如果不寻找特定客户,则删除 partner_ids 条件