Skip to content

Commit

Permalink
up up up
Browse files Browse the repository at this point in the history
  • Loading branch information
vava-odoo committed Sep 27, 2024
1 parent fcbaa86 commit 066c3ea
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 103 deletions.
7 changes: 3 additions & 4 deletions beverage_distributor/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
'calendar',
'knowledge',
'mrp',
'point_of_sale',
'pos_loyalty',
'product_barcodelookup',
'sale_crm',
'sale_management',
'sale_purchase',
'sale_service',
'sales_team',
'web_studio',
'website_crm',
'website_sale',
Expand All @@ -24,6 +22,7 @@
'theme_bistro',
],
'data': [
'data/product_category.xml',
'data/ir_attachment_pre.xml',
'data/ir_model_fields.xml',
'data/ir_ui_view.xml',
Expand All @@ -33,7 +32,6 @@
'data/product_public_category.xml',
'data/pos_category.xml',
'data/account_tax.xml',
'data/product_category.xml',
'data/product_template.xml',
'data/product_attribute.xml',
'data/product_attribute_value.xml',
Expand All @@ -50,8 +48,8 @@
'data/delivery_carrier.xml',
'data/ir_model_data.xml',
'data/ir_attachment_post.xml',
'data/res_config_settings.xml',
'data/pos_config.xml',
'data/res_config_settings.xml',
],
'demo': [
'demo/website.xml',
Expand All @@ -74,6 +72,7 @@
'demo/validate_deliveries.xml',
'demo/validate_receipts.xml',
'demo/mail_activity.xml',
'demo/delivery_carrier.xml',
'demo/payment_provider_demo_post.xml',
],
'license': 'OPL-1',
Expand Down
112 changes: 27 additions & 85 deletions beverage_distributor/data/ir_model_fields.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<record id="new_checkbox_bill_of_43688684-6f47-4c2d-8e5c-5b315cb982a5" model="ir.model.fields">
<field name="name">x_boolean_field</field>
<field name="field_description">New CheckBox</field>
<field name="ttype">boolean</field>
<field name="model_id" ref="mrp.model_mrp_bom"/>
<field name="on_delete" eval="False"/>
</record>
<record id="new_checkbox_bill_of_a8a3f45a-2758-42d1-b928-f6483c848aed" model="ir.model.fields">
<field name="name">x_auto_production</field>
<field name="field_description">Auto-production</field>
<field name="ttype">boolean</field>
<field name="model_id" ref="mrp.model_mrp_bom"/>
<field name="on_delete" eval="False"/>
</record>
<record id="new_checkbox_bill_of_cea41e6c-d23a-49ba-a3fe-2fff23cebc8d" model="ir.model.fields">
<field name="name">x_inverted_bom</field>
<field name="field_description">Inverted BOM</field>
<field name="ttype">boolean</field>
<field name="model_id" ref="mrp.model_mrp_bom"/>
<field name="on_delete" eval="False"/>
</record>
<record id="new_integer_product_0a368c52-61ad-47ed-bce5-2ee0b8fe3b5a" model="ir.model.fields">
<field name="name">x_quantity_by_deposit_product</field>
<field name="field_description">Contains</field>
Expand All @@ -35,103 +21,59 @@
<field name="model_id" ref="mrp.model_mrp_bom"/>
<field name="relation">product.template</field>
</record>
<record id="new_many2one_minimum_1c351420-777c-429b-a64f-b478bb5cc3bf" model="ir.model.fields">
<field name="name">x_parent_product_1</field>
<field name="field_description">Parent product </field>
<field name="ttype">many2one</field>
<field name="model_id" ref="stock.model_stock_warehouse_orderpoint"/>
<field name="relation">product.template</field>
</record>
<record id="new_many2one_minimum_7a298334-7e17-48ef-a722-bef9da188cfb" model="ir.model.fields">
<field name="name">x_parent_product</field>
<field name="field_description">Parent product </field>
<field name="ttype">many2one</field>
<field name="model_id" ref="stock.model_stock_warehouse_orderpoint"/>
<field name="relation">product.template</field>
</record>
<record id="x_is_a_deposit" model="ir.model.fields">
<field name="name">x_is_a_deposit</field>
<field name="field_description">Is a deposit</field>
<field name="ttype">boolean</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="depends">categ_id</field>
<field name="readonly" eval="True"/>
<field name="compute"><![CDATA[
for product in self:
product['x_is_a_deposit'] = product.categ_id == self.env.ref('beverage_distributor.product_category_7')
]]></field>
</record>
<record id="x_is_a_drink" model="ir.model.fields">
<field name="name">x_is_a_drink</field>
<field name="field_description">Is a drink</field>
<field name="ttype">boolean</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="depends">categ_id</field>
<field name="readonly" eval="True"/>
<field name="compute"><![CDATA[
for product in self:
product['x_is_a_drink'] = product.categ_id.parent_id == self.env.ref('beverage_distributor.product_category_11')
]]></field>
</record>
<record id="new_many2one_product_6472fca6-512d-44c1-b981-014315facd0b" model="ir.model.fields">
<field name="name">x_deposit_product</field>
<field name="field_description">Empty deposit product</field>
<field name="ttype">many2one</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="relation">product.template</field>
<field name="domain">[('x_is_a_deposit', '=', True)]</field>
</record>
<record id="new_many2one_product_76032120-39d2-4474-98d7-123e900a3d46" model="ir.model.fields">
<field name="name">x_unit_sale_product</field>
<field name="field_description">Unit sale product</field>
<field name="ttype">many2one</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="relation">product.product</field>
<field name="domain">[('x_is_a_drink', '=', True)]</field>
</record>
<record id="new_many2one_product_f2d0c7b8-eb9a-424c-8ea1-5871cbb556e9" model="ir.model.fields">
<field name="name">x_deposit_product_1</field>
<field name="field_description">Deposit product</field>
<field name="ttype">many2one</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="relation">product.template</field>
</record>
<record id="new_one2many_product_3f9ffe1f-7510-42d1-b2cc-59a0f4be9b74" model="ir.model.fields">
<field name="name">x_one2many_field_2lq_1i82k4pp8</field>
<field name="field_description">New One2Many</field>
<field name="ttype">one2many</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="on_delete" eval="False"/>
<field name="relation">product.template</field>
<field name="relation_field">x_unit_sale_product</field>
</record>
<record id="new_related_field_pr_45c6931e-2aef-4408-8b94-4cb2b439b1c5" model="ir.model.fields">
<field name="name">x_related_field_5cr_1i87f971e</field>
<field name="field_description">New deposit product 1</field>
<field name="related">x_deposit_product_1</field>
<field name="ttype">many2one</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="readonly" eval="True"/>
<field name="relation">product.template</field>
<field name="store" eval="False"/>
</record>
<record id="new_related_field_pr_462555c4-8f26-4bdc-9c77-c18a22d34635" model="ir.model.fields">
<field name="name">x_related_field_739_1i87f45ub</field>
<field name="field_description">New deposit product 1 related</field>
<field name="related">x_deposit_product_1.taxes_id.id</field>
<field name="ttype">integer</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="on_delete" eval="False"/>
<field name="readonly" eval="True"/>
<field name="store" eval="False"/>
</record>
<record id="new_related_field_pr_9d64d00f-058c-402a-ac6e-99373f93f2b3" model="ir.model.fields">
<field name="name">x_related_field_pv_1i87f2t31</field>
<field name="field_description">New Related Field 1</field>
<field name="related">x_deposit_product_1.taxes_id.amount</field>
<field name="ttype">float</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="on_delete" eval="False"/>
<field name="readonly" eval="True"/>
<field name="store" eval="False"/>
<field name="tracking">100</field>
</record>
<record id="new_related_field_pr_cb8a0272-74d7-4475-952d-d69a43ec2f96" model="ir.model.fields">
<field name="name">x_related_field_4ni_1i87fc9h5</field>
<field name="field_description">New Related Field 4</field>
<field name="related">x_deposit_product_1.taxes_id</field>
<field name="ttype">many2many</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="on_delete" eval="False"/>
<field name="readonly" eval="True"/>
<field name="relation">account.tax</field>
<field name="relation_table">x_account_tax_product_template_rel_1</field>
<field name="store" eval="False"/>
</record>
<record id="new_related_field_pr_ccd5286f-bea3-4fb3-b5e8-72f1f9093484" model="ir.model.fields">
<field name="name">x_related_field_2n6_1i87f0dq8</field>
<field name="field_description">New Related field 2</field>
<field name="related">x_deposit_product_1.taxes_id</field>
<field name="ttype">many2many</field>
<field name="model_id" ref="product.model_product_template"/>
<field name="on_delete" eval="False"/>
<field name="readonly" eval="True"/>
<field name="relation">account.tax</field>
<field name="relation_table">x_account_tax_product_template_rel</field>
<field name="store" eval="False"/>
<field name="domain">[('x_is_a_deposit', '=', True)]</field>
</record>
</odoo>
14 changes: 5 additions & 9 deletions beverage_distributor/data/ir_ui_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_tooltip']" position="after">
<field name="x_deposit_product_1" string="Deposit product"
domain="[('categ_id', '=', ('product_category_7'))]" invisible="not x_unit_sale_product"/>
<label for="x_quantity_by_deposit_product" invisible="not x_unit_sale_product" string="Contains"/>
<div class="d-flex" name="studio_div_1e3609">
<field class="oe_inline" name="x_quantity_by_deposit_product" invisible="not x_unit_sale_product"/>
<field name="x_deposit_product_1" invisible="x_is_a_deposit"/>
<label for="x_quantity_by_deposit_product" invisible="x_is_a_deposit"/>
<div class="d-flex" name="studio_div_1e3609" invisible="x_is_a_deposit">
<field class="oe_inline" name="x_quantity_by_deposit_product"/>
<field name="x_unit_sale_product" placeholder="ex. Delta I.P.A. - 33cl"
help="Leave empty if this product is the smallest unit"
domain="[('categ_id.parent_id', '=', ('product_category_11'))]"
invisible="not x_unit_sale_product"/>
help="Leave empty if this product is the smallest unit"/>
</div>
<field name="x_deposit_product" string="Empty deposit product" invisible="not x_unit_sale_product"
domain="[('categ_id', '=', ('product_category_7'))]"
help="Deposit product must be set in Deposit category"/>
</xpath>
</field>
Expand Down
4 changes: 2 additions & 2 deletions beverage_distributor/data/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<field name="is_storable" eval="True"/>
<field name="image_1920" type="base64" file="beverage_distributor/static/src/binary/product_template/9-image_1920"/>
<field name="purchase_method">receive</field>
<field name="taxes_id" eval="[(6, 0, [ref('account_tax_24_sale')])]"/>
<field name="supplier_taxes_id" eval="[(6, 0, [ref('account_tax_24_purchase')])]"/>
<field name="taxes_id" eval="[(5, 0, 0), (4, 0, [ref('account_tax_24_sale')])]"/>
<field name="supplier_taxes_id" eval="[(5, 0, 0), (4, 0, [ref('account_tax_24_purchase')])]"/>
</record>
<record id="product_template_51" model="product.template" context="{'create_product_product': False}">
<field name="name">Coca-cola 24x33cl</field>
Expand Down
6 changes: 6 additions & 0 deletions beverage_distributor/demo/delivery_carrier.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<odoo noupdate="1">
<record id="delivery_carrier_1" model="delivery.carrier">
<field name="is_published" eval="True"/>
</record>
</odoo>
6 changes: 3 additions & 3 deletions beverage_distributor/demo/mail_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
<odoo noupdate="1">
<record id="mail_activity_1" model="mail.activity">
<field name="res_model_id" ref="crm.model_crm_lead"/>
<field name="date_deadline">2024-09-16</field>
<field name="date_deadline" eval="(DateTime.today() + relativedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
<field name="res_model">crm.lead</field>
<field name="res_id" ref="crm_lead_2"/>
<field name="activity_type_id" ref="mail.mail_activity_data_call"/>
<field name="res_name">Restaurant Beverage Partnership</field>
</record>
<record id="mail_activity_2" model="mail.activity">
<field name="res_model_id" ref="crm.model_crm_lead"/>
<field name="date_deadline">2024-09-26</field>
<field name="date_deadline" eval="(DateTime.today() - relativedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
<field name="res_model">crm.lead</field>
<field name="res_id" ref="crm_lead_5"/>
<field name="activity_type_id" ref="mail.mail_activity_data_todo"/>
<field name="res_name">Bar Wholesale Agreement</field>
</record>
<record id="mail_activity_3" model="mail.activity">
<field name="res_model_id" ref="crm.model_crm_lead"/>
<field name="date_deadline">2024-09-22</field>
<field name="date_deadline" eval="DateTime.today()"/>
<field name="res_model">crm.lead</field>
<field name="res_id" ref="crm_lead_6"/>
<field name="activity_type_id" ref="mail.mail_activity_data_todo"/>
Expand Down

0 comments on commit 066c3ea

Please sign in to comment.