Skip to content

Commit

Permalink
Merge branch '17.0' into 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 authored Jan 20, 2025
2 parents 267027c + c79e953 commit 1eb9e30
Show file tree
Hide file tree
Showing 109 changed files with 2,105 additions and 2,268 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ repos:
# so it's added as a manual job. If you automate it, beware.
# See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages
- id: oca-gen-addons-table
stages: [manual]
# stages: [manual]
# update the NOT INSTALLABLE ADDONS section above

- id: oca-update-pre-commit-excluded-addons
Expand Down
33 changes: 18 additions & 15 deletions README.md

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions deltatech/static/description/main_screenshot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions deltatech_alternative/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@

{
"name": "Products Alternative",
"version": "17.0.2.0.7",
"version": "17.0.2.0.8",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"summary": "Alternative product codes",
"category": "Sales",
"depends": ["product", "stock", "sale", "purchase"],
"license": "OPL-1",
"data": [
"views/product_view.xml",
"views/product_template_view.xml",
"views/product_product_view.xml",
"views/product_alternative_view.xml",
"views/sale_order_view.xml",
"views/purchase_order_view.xml",
"views/stock_move_view.xml",
Expand Down
2 changes: 1 addition & 1 deletion deltatech_alternative/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ProductAlternative(models.Model):
_name = "product.alternative"
_description = "Product alternative"

name = fields.Char(string="Code", index=True, unaccent=False)
name = fields.Char(string="Code", index="btree_not_null")
sequence = fields.Integer(string="sequence", default=10)
product_tmpl_id = fields.Many2one("product.template", string="Product Template", ondelete="cascade")
hide = fields.Boolean(string="Hide")
28 changes: 28 additions & 0 deletions deltatech_alternative/views/product_alternative_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="product_alternative_tree_view">
<field name="name">product.alternative.tree</field>
<field name="model">product.alternative</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="product_tmpl_id" />
<field name="sequence" widget="handle" />
<field name="name" />
<field name="hide" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="product_alternative_form_view">
<field name="name">product.alternative.form</field>
<field name="model">product.alternative</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Alternatives">
<field name="product_tmpl_id" />
<field name="name" />
<field name="hide" />
</form>
</field>
</record>
</odoo>
53 changes: 53 additions & 0 deletions deltatech_alternative/views/product_product_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" ?>
<odoo>
<record id="product_product_alternative_search_form_view" model="ir.ui.view">
<field name="name">product.product.search</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="alternative_ids" />
<field
name="variant_seller_ids"
string="Vendor Code"
filter_domain="[('seller_ids.product_code', 'ilike', self)]"
/>
</field>
</field>
</record>

<record id="product_view_search_catalog" model="ir.ui.view">
<field name="name">product.view.search.alternative.catalog</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_view_search_catalog" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="alternative_ids" />
</field>
</field>
</record>

<record id="product_view_kanban_catalog" model="ir.ui.view">
<field name="name">product.view.kanban.catalog</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_view_kanban_catalog" />
<field name="arch" type="xml">
<field name="product_template_attribute_value_ids" position="after">
<field name="alternative_ids" widget="many2many_tags" />
</field>
</field>
</record>

<record id="product_product_tree_alternative" model="ir.ui.view">
<field name="name">product.product.alternative.tree</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="alternative_code" />
</field>
</field>
</record>


</odoo>
64 changes: 64 additions & 0 deletions deltatech_alternative/views/product_template_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" ?>
<odoo>
<record model="ir.ui.view" id="product_alternative_search_form_view">
<field name="name">product.template.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
<field name="type">search</field>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="alternative_ids" />
<field
name="variant_seller_ids"
string="Vendor Code"
filter_domain="[('seller_ids.product_code', 'ilike', self)]"
/>
</field>
</field>
</record>

<record model="ir.ui.view" id="view_product_tree_alternative">
<field name="name">product.template.product.alternative.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view" />
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="alternative_code" />
<field name="used_for" />
</field>
</field>
</record>
<!-- <record id="view_product_template_form_alternative" model="ir.ui.view">
<field name="name">product.template.alternative.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
-->
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="priority" eval="16" />
<field name="arch" type="xml">
<group name="group_standard_price" position="after">
<group>
<field name="alternative_code" />
<field name="used_for" />
</group>
</group>
<notebook position="inside">
<page string="Alternative">
<field name="alternative_ids" colspan="4" nolabel="1">
<tree editable="bottom">
<field name="sequence" widget="handle" />
<field name="name" />
<field name="hide" />
</tree>
</field>
</page>
</notebook>
</field>
</record>


</odoo>
101 changes: 0 additions & 101 deletions deltatech_alternative/views/product_view.xml

This file was deleted.

2 changes: 1 addition & 1 deletion deltatech_card_payment/tests/test_card_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setUp(self):

def test_check_payment_method(self):
# Check if the payment method is correctly set
self.assertEqual(self.payment_method.name, "Card", "Name is not correctly set")
self.assertEqual(self.payment_method.name, "Card Payment", "Name is not correctly set")
self.assertEqual(self.payment_method.code, "card_payment", "Code is not correctly set")
self.assertEqual(self.payment_method.payment_type, "inbound", "Payment type is not correctly set")

Expand Down
68 changes: 43 additions & 25 deletions deltatech_contact/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,33 +109,51 @@ def _get_contact_name(self, partner, name):
else:
return super()._get_contact_name(partner, name)

def _get_name(self):
partner = self
context = self.env.context
name = super()._get_name()

if context.get("show_phone", False):
if partner.phone or partner.mobile:
name = f"{name}\n<{partner.phone or partner.mobile}>"
if context.get("show_category") and partner.category_id:
cat = []
for category in partner.category_id:
cat.append(category.name)
name = name + "\n[" + ",".join(cat) + "]"
if context.get("address_inline"):
name = name.replace("\n", ", ")
return name

@api.model
def name_search(self, name="", args=None, operator="ilike", limit=100):
res_vat = []
if name and len(name) > 2:
partner_ids = self.search([("vat", "ilike", name), ("is_company", "=", True)], limit=10)
if partner_ids:
res_vat = partner_ids.name_get()
res = super().name_search(name, args, operator=operator, limit=limit) + res_vat
def _compute_display_name(self):
res = super()._compute_display_name()
for partner in self:
context = self.env.context
name = partner.display_name
if context.get("show_phone", False):
if partner.phone or partner.mobile:
name = f"{name}\n<{partner.phone or partner.mobile}>"
if context.get("show_category") and partner.category_id:
cat = []
for category in partner.category_id:
cat.append(category.name)
name = name + "\n[" + ",".join(cat) + "]"
if context.get("address_inline"):
name = name.replace("\n", ", ")
partner.display_name = name
return res

# def _get_name(self):
# partner = self
# context = self.env.context
# name = super()._get_name()
#
# if context.get("show_phone", False):
# if partner.phone or partner.mobile:
# name = f"{name}\n<{partner.phone or partner.mobile}>"
# if context.get("show_category") and partner.category_id:
# cat = []
# for category in partner.category_id:
# cat.append(category.name)
# name = name + "\n[" + ",".join(cat) + "]"
# if context.get("address_inline"):
# name = name.replace("\n", ", ")
# return name

# @api.model
# def name_search(self, name="", args=None, operator="ilike", limit=100):
# res_vat = []
# if name and len(name) > 2:
# partner_ids = self.search([("vat", "ilike", name), ("is_company", "=", True)], limit=10)
# if partner_ids:
# res_vat = partner_ids.name_get()
# res = super().name_search(name, args, operator=operator, limit=limit) + res_vat
# return res

@api.model_create_multi
def create(self, vals_list):
for values in vals_list:
Expand Down
2 changes: 1 addition & 1 deletion deltatech_delivery_status/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Deltatech Delivery Status",
"summary": "Carrier status on picking",
"version": "17.0.2.0.5",
"version": "17.0.2.0.6",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"support": "[email protected]",
Expand Down
Loading

0 comments on commit 1eb9e30

Please sign in to comment.