Cron Export Stock Kit
This commit is contained in:
parent
b06b0d8ba4
commit
9092743046
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part esale_stock module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<!-- esale.cron -->
|
||||
<record model="ir.cron" id="cron_esale_export_stock_kit">
|
||||
<field name="name">eSale - Export Stock Kit</field>
|
||||
<field name="request_user" ref="res.user_admin"/>
|
||||
<field name="user" ref="esale.user_esale"/>
|
||||
<field name="active" eval="True"/>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="number_calls">-1</field>
|
||||
<field name="repeat_missed" eval="False"/>
|
||||
<field name="model">sale.shop</field>
|
||||
<field name="function">export_cron_stock_kit</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
13
shop.py
13
shop.py
|
@ -28,3 +28,16 @@ class SaleShop:
|
|||
export_products = getattr(shop,
|
||||
'export_stocks_kit_%s' % shop.esale_shop_app)
|
||||
export_products()
|
||||
|
||||
@classmethod
|
||||
def export_cron_stock_kit(cls):
|
||||
"""
|
||||
Cron export stock kit
|
||||
"""
|
||||
print "dins cron"
|
||||
shops = cls.search([
|
||||
('esale_available', '=', True),
|
||||
('esale_scheduler', '=', True),
|
||||
])
|
||||
cls.export_stocks_kit(shops)
|
||||
return True
|
||||
|
|
|
@ -5,4 +5,5 @@ depends:
|
|||
esale_stock
|
||||
product_kit
|
||||
xml:
|
||||
esale.xml
|
||||
shop.xml
|
||||
|
|
Loading…
Reference in New Issue