Skip to content

Commit

Permalink
[ADD] agriculture: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrs-odoo committed Feb 12, 2024
1 parent ab1ab0e commit 30a0efe
Show file tree
Hide file tree
Showing 19 changed files with 259 additions and 298 deletions.
4 changes: 1 addition & 3 deletions agriculture/__manifest__.py
Expand Up @@ -11,7 +11,6 @@
""",
'depends': [
'website_sale_loyalty',
'purchase',
'knowledge',
'payment_demo',
'pos_sale',
Expand All @@ -31,7 +30,6 @@
'data/pos_category.xml',
'data/pos_config.xml',
'data/product_category.xml',
'data/product_template.xml',
'data/product_pricelist.xml',
'data/product_product.xml',
'data/loyalty_program.xml',
Expand All @@ -54,7 +52,7 @@
'demo/sale_order.xml',
'demo/sale_order_line.xml',
'demo/loyalty_card.xml',
# 'demo/sale_order_post.xml',
'demo/sale_order_post.xml',
'demo/website.xml',
'demo/website_views.xml',
'demo/website_page.xml',
Expand Down
2 changes: 1 addition & 1 deletion agriculture/data/ir_attachment_pre.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<odoo noupdate="1">
<record id="ir_attachment_583" model="ir.attachment">
<field name="name">Agro Covercc.png</field>
<field name="datas" type="base64" file="agriculture/static/src/binary/ir_attachment/583-AgroCovercc.png"/>
Expand Down
4 changes: 1 addition & 3 deletions agriculture/data/ir_model_fields.xml
@@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="new_image_product_binary" model="ir.model.fields">
<field name="name">x_binary_field_product_template</field>
<field name="model">product.template</field>
<field name="ttype">binary</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="field_description">Product Making Story - QR Code</field>
<field name="copied" eval="True"/>
<field name="on_delete" eval="False"/>
</record>
<record id="new_many2one_lead_survey" model="ir.model.fields">
Expand All @@ -14,7 +14,6 @@
<field name="model">crm.lead</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_description">Survey</field>
<field name="copied" eval="True"/>
<field name="relation">survey.survey</field>
</record>
<record id="new_many2one_lead_answer" model="ir.model.fields">
Expand All @@ -23,7 +22,6 @@
<field name="model">crm.lead</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="field_description">Answer</field>
<field name="copied" eval="True"/>
<field name="relation">survey.user_input</field>
</record>
<record id="new_related_field_product_story" model="ir.model.fields">
Expand Down
2 changes: 1 addition & 1 deletion agriculture/data/knowledge_article.xml
Expand Up @@ -2,7 +2,7 @@
<odoo>
<record id="knowledge_article_1" model="knowledge.article">
<field name="name">Agriculture Retails</field>
<field name="inherited_permission">write</field>
<field name="internal_permission">write</field>
<field name="icon">🍀</field>
<field name="cover_image_id" ref="knowledge_cover_6"/>
<field name="is_article_visible_by_everyone" eval="True"/>
Expand Down
2 changes: 1 addition & 1 deletion agriculture/data/knowledge_cover.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<odoo noupdate="1">
<record id="knowledge_cover_6" model="knowledge.cover">
<field name="attachment_id" ref="ir_attachment_583"/>
</record>
Expand Down
4 changes: 2 additions & 2 deletions agriculture/data/pos_category.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<odoo noupdate="1">
<record id="pos_category_1" model="pos.category">
<field name="name">Seeds</field>
</record>
Expand All @@ -12,4 +12,4 @@
<record id="pos_category_4" model="pos.category">
<field name="name">Plant Nutrition</field>
</record>
</odoo>
</odoo>
4 changes: 2 additions & 2 deletions agriculture/data/pos_config.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="point_of_sale.pos_config_main" model="pos.config">
<field name="start_category" eval="1"/>
<field name="iface_available_categ_ids" eval="[Command.link(ref('pos_category_1')), Command.link(ref('pos_category_2')), Command.link(ref('pos_category_3')), Command.link(ref('pos_category_4'))]"/>
Expand Down
229 changes: 209 additions & 20 deletions agriculture/data/product_product.xml

Large diffs are not rendered by default.

252 changes: 0 additions & 252 deletions agriculture/data/product_template.xml

This file was deleted.

4 changes: 3 additions & 1 deletion agriculture/demo/crm_lead.xml
Expand Up @@ -3,11 +3,13 @@
<record id="crm_lead_4" model="crm.lead">
<field name="name">Farmer required Onion Seed</field>
<field name="x_survey" ref="survey_survey_2"/>
<field name="user_id" ref="base.user_admin"/>
</record>
<record id="crm_lead_6" model="crm.lead">
<field name="name">need price for Fertilizer</field>
<field name="partner_id" ref="res_partner_10"/>
<field name="user_id" ref="base.user_admin"/>
<field name="x_survey" ref="survey_survey_2"/>
<field name="description"><![CDATA[ <p>Please tell me the price for fertilizer</p>]]></field>
<field name="partner_id" ref="res_partner_10"/>
</record>
</odoo>
6 changes: 3 additions & 3 deletions agriculture/demo/product_supplierinfo.xml
Expand Up @@ -2,14 +2,14 @@
<odoo noupdate="1">
<record id="product_supplierinfo_1" model="product.supplierinfo">
<field name="partner_id" ref="res_partner_7"/>
<field name="product_tmpl_id" ref="product_template_6"/>
<field name="product_tmpl_id" model="product.product" eval="obj().env.ref('agriculture.product_product_6').product_tmpl_id.id"/>
<field name="price">1230.0</field>
<field name="min_qty">1.0</field>
</record>
<record id="product_supplierinfo_2" model="product.supplierinfo">
<field name="partner_id" ref="res_partner_7"/>
<field name="product_tmpl_id" ref="product_template_8"/>
<field name="product_tmpl_id" model="product.product" eval="obj().env.ref('agriculture.product_product_8').product_tmpl_id.id"/>
<field name="price">100.0</field>
<field name="min_qty">1.0</field>
<field name="min_qty">100.0</field>
</record>
</odoo>
5 changes: 5 additions & 0 deletions agriculture/demo/purchase_order.xml
Expand Up @@ -2,11 +2,16 @@
<odoo noupdate="1">
<record id="purchase_order_1" model="purchase.order">
<field name="partner_id" ref="res_partner_7"/>
<field name="user_id" ref="base.user_admin"/>
</record>
<record id="purchase_order_2" model="purchase.order">
<field name="partner_id" ref="res_partner_8"/>
<field name="user_id" ref="base.user_admin"/>
</record>
<record id="purchase_order_1" model="purchase.order">
<field name="alternative_po_ids" eval="[Command.link(ref('purchase_order_2'))]"/>
</record>
<record id="cancel_alternative" model="purchase.requisition.alternative.warning">
<field name="alternative_po_ids" eval="[Command.link(ref('purchase_order_2'))]"/>
</record>
</odoo>
2 changes: 0 additions & 2 deletions agriculture/demo/purchase_order_line.xml
@@ -1,12 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="purchase_order_line_1" model="purchase.order.line">
<field name="name">Onion Seeds (1 Kg)</field>
<field name="product_id" ref="product_product_8"/>
<field name="order_id" ref="purchase_order_1"/>
</record>
<record id="purchase_order_line_2" model="purchase.order.line">
<field name="name">Onion Seeds (1 Kg)</field>
<field name="product_id" ref="product_product_8"/>
<field name="order_id" ref="purchase_order_2"/>
<field name="price_unit">110</field>
Expand Down
13 changes: 9 additions & 4 deletions agriculture/demo/purchase_order_post.xml
Expand Up @@ -2,19 +2,24 @@
<odoo>
<function name="action_choose" model="purchase.order.line">
<value eval="[
ref('purchase_order_line_1'),
ref('purchase_order_line_1')
]"/>
</function>
<!-- <function name="button_confirm" model="purchase.order">
<function name="action_cancel_alternatives" model="purchase.requisition.alternative.warning">
<value eval="[
ref('cancel_alternative'),
]"/>
</function>
<function name="button_confirm" model="purchase.order">
<value eval="[ref('purchase_order_1'),]"/>
</function>

<function name="write" model="stock.move.line">
<value model="stock.move.line" eval="obj().search([('picking_id', '=', obj().env.ref('agriculture.purchase_order_1').picking_ids.id)]).id"/>
<value model="stock.lot" eval="{'lot_id': ref('agriculture.stock_lot_2'), 'lot_name': obj().env.ref('agriculture.stock_lot_2').name}"/>
<value model="stock.lot" eval="{'lot_id': ref('stock_lot_2'), 'lot_name': obj().env.ref('agriculture.stock_lot_2').name}"/>
</function>

<function name="button_validate" model="stock.picking">
<value model="stock.picking" eval="obj().env.ref('agriculture.purchase_order_1').group_id.stock_move_ids.picking_id.ids"/>
</function> -->
</function>
</odoo>
1 change: 1 addition & 0 deletions agriculture/demo/res_partner.xml
@@ -1,3 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="res_partner_10" model="res.partner">
<field name="name">Shailendra Rathod(SRA)</field>
Expand Down
2 changes: 2 additions & 0 deletions agriculture/demo/sale_order.xml
Expand Up @@ -2,11 +2,13 @@
<odoo noupdate="1">
<record id="sale_order_1" model="sale.order">
<field name="partner_id" ref="res_partner_10"/>
<field name="user_id" ref="base.user_admin"/>
<field name="website_id" ref="website.default_website"/>
<field name="carrier_id" ref="delivery.free_delivery_carrier"/>
<field name="code_enabled_rule_ids" eval="[(6, 0, [ref('loyalty_rule_2')])]"/>
</record>
<record id="sale_order_2" model="sale.order">
<field name="partner_id" ref="res_partner_9"/>
<field name="user_id" ref="base.user_admin"/>
</record>
</odoo>
3 changes: 2 additions & 1 deletion agriculture/demo/sale_order_line.xml
@@ -1,4 +1,5 @@
<odoo>
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="sale_order_line_2" model="sale.order.line">
<field name="name">[0001] Tomato Seeds (1 Kg)
Tomato seeds are the foundation of vibrant home gardens and lush farms, holding the potential to grow into a diverse array of delicious and nutritious tomato plants. From classic red varieties to unique colors and shapes, these seeds offer the joy of cultivating fresh and flavorful tomatoes.</field>
Expand Down
16 changes: 15 additions & 1 deletion agriculture/demo/sale_order_post.xml
@@ -1,8 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<function name="action_confirm" model="sale.order" eval="[[ref('sale_order_1')]]"/>
<!-- Confirm action -->
<function name="action_confirm" model="sale.order" eval="[[ref('sale_order_1'), ref('sale_order_2')]]"/>

<function name="button_validate" model="stock.picking" context="{'skip_sms': True}">
<value model="stock.picking" eval="obj().env.ref('agriculture.sale_order_1').procurement_group_id.stock_move_ids.picking_id.ids"/>
</function>

<!-- Create Invoice -->
<record id="sale_advance_payment_inv_2" model="sale.advance.payment.inv">
<field name="advance_payment_method" >delivered</field>
<field name="sale_order_ids" eval="[Command.set([ref('sale_order_2')])]"/>
</record>

<function model="sale.advance.payment.inv" name="create_invoices" eval="[ref('sale_advance_payment_inv_2')]"/>

<!-- Confirm invoice -->
<function model="account.move" name="action_post">
<value model="account.move" eval="obj().env.ref('agriculture.sale_order_2').invoice_ids.ids"/>
</function>
</odoo>
2 changes: 1 addition & 1 deletion agriculture/demo/website_views.xml
Expand Up @@ -303,7 +303,7 @@
</div>
<div class="s_website_form_field mb-3 col-12 s_website_form_required" data-type="text" data-name="Field">
<div class="row s_col_no_resize s_col_no_bgcolor">
agriculture.<label class="col-form-label col-sm-auto s_website_form_label" style="width: 200px" for="input-question">
<label class="col-form-label col-sm-auto s_website_form_label" style="width: 200px" for="input-question">
<span class="s_website_form_label_content">Your Question</span>
<span class="s_website_form_mark"> *</span>
</label>
Expand Down

0 comments on commit 30a0efe

Please sign in to comment.